# mypy-boto3-xray
Type annotations for
[boto3.XRay 1.11.1](https://boto3.amazonaws.com/v1/documentation/api/1.11.1/reference/services/xray.html#XRay) service
compatible with [mypy](https://github.com/python/mypy), [VSCode](https://code.visualstudio.com/),
[PyCharm](https://www.jetbrains.com/pycharm/) and other tools.
More information can be found [here](https://vemel.github.io/mypy_boto3/).
- [mypy-boto3-xray](#mypy-boto3-xray)
- [How to use](#how-to-use)
- [Type checking](#type-checking)
- [Code auto-complete](#code-auto-complete)
- [How it works](#how-it-works)
## How to use
### Type checking
Make sure you have [mypy](https://github.com/python/mypy) installed and activated in your IDE.
Install `boto3-stubs` for `XRay` service.
```bash
python -m pip install boto3-stubs[mypy-boto3-xray]
```
Use `boto3` with `mypy_boto3` in your project and enjoy type checking and auto-complete.
```python
import boto3
from mypy_boto3 import xray
# alternative import if you do not want to install mypy_boto3 package
# import mypy_boto3_xray as xray
# Use this client as usual, now mypy can check if your code is valid.
# Check if your IDE supports function overloads,
# you probably do not need explicit type annotations
# client = boto3.client("xray")
client: xray.XRayClient = boto3.client("xray")
# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: xray.XRayClient = session.client("xray")
# Paginators need type annotation on creation
batch_get_traces_paginator: xray.BatchGetTracesPaginator = client.get_paginator("batch_get_traces")
get_groups_paginator: xray.GetGroupsPaginator = client.get_paginator("get_groups")
get_sampling_rules_paginator: xray.GetSamplingRulesPaginator = client.get_paginator("get_sampling_rules")
get_sampling_statistic_summaries_paginator: xray.GetSamplingStatisticSummariesPaginator = client.get_paginator("get_sampling_statistic_summaries")
get_service_graph_paginator: xray.GetServiceGraphPaginator = client.get_paginator("get_service_graph")
get_time_series_service_statistics_paginator: xray.GetTimeSeriesServiceStatisticsPaginator = client.get_paginator("get_time_series_service_statistics")
get_trace_graph_paginator: xray.GetTraceGraphPaginator = client.get_paginator("get_trace_graph")
get_trace_summaries_paginator: xray.GetTraceSummariesPaginator = client.get_paginator("get_trace_summaries")
```
## How it works
Fully automated [builder](https://github.com/vemel/mypy_boto3) carefully generates
type annotations for each service, patiently waiting for `boto3` updates. It delivers
a drop-in type annotations for you and makes sure that:
- All available `boto3` services are covered.
- Each public class and method of every `boto3` service gets valid type annotations
extracted from the documentation (blame `botocore` docs if types are incorrect).
- Type annotations include up-to-date documentation.
- Link to documentation is provided for every method.
- Code is processed by [black](https://github.com/psf/black) for readability.
PyPI 官网下载 | mypy-boto3-xray-1.11.1.0.tar.gz
版权申诉
128 浏览量
2022-01-14
05:19:57
上传
评论
收藏 11KB GZ 举报
挣扎的蓝藻
- 粉丝: 12w+
- 资源: 15万+
最新资源
- MyBatis 动态 SQL:灵活而强大的查询构建器.pdf
- com.accordion.prettyo.apk
- 毕业设计:基于SSM的mysql-ssm软件bug管理系统(源码 + 数据库 + 说明文档)
- MTSQL8.0.35windows(64bit)-mysql-installer-community-8.0.35.0
- 人工智能引领音乐创作新时代之Suno AI
- Public-bicycle-usage-forecast-master.zip
- 通道处理过程模拟:从理论到实践.pdf
- 数据库第七次作业E-R图第一题
- 大厂面试真题Java语法基础面试专题及答案
- IMG20240428211124.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈