Type annotations for boto3 1.14.0 master module, generated by mypy-boto3-buider 2.0.4
Project description
mypy-boto3
Dynamic boto3 1.14.0 type annotations builder for boto3-stubs.
Generated by mypy-boto3-buider 2.0.4.
More information can be found on boto3-stubs page.
How to install
# Install type annotations for boto3 services you use
# mypy-boto3 should be installed as a dependency
python -m pip install 'boto3-stubs[s3,ec2]'
How to uninstall
# remove generated files and cache
python -m mypy_boto3 --clean
python -m pip uninstall mypy_boto3
Usage
Generate dynamic type annotations for services you installed
# Run this command after you add or remove service packages
python -m mypy_boto3
Generated files
mypy_boto3
command creates or updates these files in it's installation directory:
boto3_init_gen.py
- annotations forboto3.client/resource
boto3_session_gen.py
- annotations forboto3.Session().client/resource
cache.txt
- information about installed services<service>/__init__.py
- Allows to usemypy_boto3.s3
import instead ofmypy_boto3_s3
<service>/client.py
- Allows to usemypy_boto3.s3.client
import instead ofmypy_boto3_s3.client
<service>/type_defs.py
- Allows to usemypy_boto3.s3.type_defs
import instead ofmypy_boto3_s3.type_defs
<service>/service_resource.py
- Allows to usemypy_boto3.s3.service_resource
import instead ofmypy_boto3_s3.service_resource
<service>/waiter.py
- Allows to usemypy_boto3.s3.waiter
import instead ofmypy_boto3_s3.waiter
<service>/paginator.py
- Allows to usemypy_boto3.s3.paginator
import instead ofmypy_boto3_s3.paginator
<service>
is boto3
service name, e.g. s3
. For lambda
service, it is mypy_boto3.lambda_
.
Dynamic type annotations
Generated files provide overloads for boto3.client
, boto3.resource
,
boto3.Session.client
and boto3.Session.resource
functions for services currently installed,
so explicit type annotations are not needed.
mypy
supports function overloads as expectedPyCharm
also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installedVSCode
does not currently support function overloads, use explicit type annotations
import boto3
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("s3")
resource = boto3.resource("s3")
session_client = boto3.Session().client("s3")
session_resource = boto3.Session().resource("s3")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mypy_boto3-1.14.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6d2653001760974765a156c92c2eda337b5b1e76edb356adf02cac55a1b85b3 |
|
MD5 | 9778d23d8ff16b587def45ed20b0dd4a |
|
BLAKE2b-256 | 80e87e0f3ec9e2ffdfb8275100dfa648652e5a37a2aa432c840c65d9c8b7ec01 |