python aws数据类
python-aws-dataclasses的Python项目详细描述
python aws数据类[wip]
python aws数据类为aws lambda事件和其他aws数据提供数据类。 数据类是带类型注释的,以允许完全的IDE(代码完成/智能感知)支持。
快速启动
安装
# using pip pip install python-aws-dataclasses # or using pipenv pipenv install python-aws-dataclasses.git
使用量
假设您有一些aws事件的dict(例如传递到您的lambda_handler
中的事件),使用from_event()
-方法并通过dot-符号访问对象。
deflambda_handler(event,context):# Example 1: Lambda asynchronously invoked via SNSsns_event=SnsEvent.from_event(event)print(sns_event.first_record.sns.message)# Example 2: Lambda asynchronously invoked via S3-Events3_event=S3Event.from_event(event)print(s3_event.first_record.s3.bucket.name)
贡献
每个人都可以自由贡献和提交请求。
其他
使用tox进行测试
tox
使用setup.py进行测试
python setup.py test