# mypy-boto3

[![PyPI - {{ package.pypi_name }}]({{ package.url.pypi_badge }})]({{ package.url.pypi }})
[![PyPI - Python Version]({{ package.url.pyversions_badge }})]({{ package.url.pypi }})
[![Docs]({{ package.url.rtd_badge }})]({{ package.url.docs }})
[![PyPI - Downloads]({{ package.url.pepy_badge }}]({{ package.url.pypistats }})

![boto3.typed]({{ builder_repo_url }}/raw/main/logo.png)

Dynamic [{{ package.library_name }} {{ package.library_version }}](https://boto3.amazonaws.com/v1/documentation/api/{{ package.library_version }}/index.html)

Generated with [{{ builder_package_name }} {{ builder_version }}]({{ builder_repo_url }}).

More information can be found on [types-boto3](https://pypi.org/project/types-boto3/) page.

See how it helps to find and fix potential bugs:

![types-boto3 demo]({{ builder_repo_url }}/raw/main/demo.gif)

## How to install

```bash
# Install this package
python -m pip install types-boto3

# Install type annotations for boto3 services you use
python -m pip install 'types-boto3[s3,ec2]'

# Lite version does not provide session.client/resource overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'types-boto3-lite[s3,ec2]'
```

## Usage

Provides `ServiceName` and `ResourceServiceName` literals:

```python
from typing import overload

import boto3
from botocore.client import BaseClient
from types_boto3.literals import ServiceName
from types_boto3_ec2.client import EC2Client
from types_boto3_ec2.literals import EC2ServiceName
from types_boto3_s3.client import S3Client
from types_boto3_s3.literals import S3ServiceName


@overload
def get_client(service_name: EC2ServiceName) -> EC2Client: ...


@overload
def get_client(service_name: S3ServiceName) -> S3Client: ...


@overload
def get_client(service_name: ServiceName) -> BaseClient: ...


def get_client(service_name: ServiceName) -> BaseClient:
    return boto3.client(service_name)


# type: S3Client, fully type annotated
# All methods and attributes are auto-completed and type checked
s3_client = get_client("s3")

# type: EC2Client, fully type annotated
# All methods and attributes are auto-completed and type checked
ec2_client = get_client("ec2")

# type: BaseClient, only basic type annotations
# Dynamodb-specific methods and attributes are not auto-completed and not type checked
dynamodb_client = get_client("dynamodb")
```

### Latest changes

Full changelog can be found in [Releases](https://github.com/youtype/mypy_boto3_builder/releases).

## Versioning

`{{ package.pypi_name }}` version is the same as related `boto3` version and follows
[Python Packaging version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/).

## Support and contributing

Please reports any bugs or request new features in
[mypy_boto3_builder](https://github.com/youtype/mypy_boto3_builder/issues/) repository.
