Skip to main content

Type annotations for boto3 1.14.29 master module, generated by mypy-boto3-buider 2.2.0

Project description

mypy-boto3

PyPI - mypy-boto3 PyPI - Python Version Docs

Dynamic boto3 1.14.29 type annotations builder for boto3-stubs.

Generated by mypy-boto3-buider 2.2.0.

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 for boto3.client/resource
  • boto3_session_gen.py - annotations for boto3.Session().client/resource
  • cache.txt - information about installed services
  • <service>/__init__.py - Allows to use mypy_boto3.s3 import instead of mypy_boto3_s3
  • <service>/client.py - Allows to use mypy_boto3.s3.client import instead of mypy_boto3_s3.client
  • <service>/type_defs.py - Allows to use mypy_boto3.s3.type_defs import instead of mypy_boto3_s3.type_defs
  • <service>/service_resource.py - Allows to use mypy_boto3.s3.service_resource import instead of mypy_boto3_s3.service_resource
  • <service>/waiter.py - Allows to use mypy_boto3.s3.waiter import instead of mypy_boto3_s3.waiter
  • <service>/paginator.py - Allows to use mypy_boto3.s3.paginator import instead of mypy_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 expected
  • PyCharm also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installed
  • VSCode 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

mypy-boto3-1.14.29.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mypy_boto3-1.14.29.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file mypy-boto3-1.14.29.0.tar.gz.

File metadata

  • Download URL: mypy-boto3-1.14.29.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for mypy-boto3-1.14.29.0.tar.gz
Algorithm Hash digest
SHA256 a3c174cbd270583b02e020089a3de2b365fa1855a596ee86b010e059d74fa27c
MD5 e5c46a7965872cb3b7bb974ae079807c
BLAKE2b-256 a2e941a18cc14452e88a6382a24fe1196045bd91e1abe267bdf4beafd5f304b8

See more details on using hashes here.

File details

Details for the file mypy_boto3-1.14.29.0-py3-none-any.whl.

File metadata

  • Download URL: mypy_boto3-1.14.29.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

File hashes

Hashes for mypy_boto3-1.14.29.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b56ce6809525380e3787be37484d68bdb269f4c45d18d5b811848bd631363548
MD5 008a4b4f3a7a60d7f296659cf732e0b6
BLAKE2b-256 71c13f26d31b45c2a55aa5fababfdc9dc49e812571900b2b0c980ec47b920c9d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page