Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/boto/botostubs
Type stubs for botocore and boto3. **Note: This project is a work in-progess**
https://github.com/boto/botostubs
Last synced: 30 days ago
JSON representation
Type stubs for botocore and boto3. **Note: This project is a work in-progess**
- Host: GitHub
- URL: https://github.com/boto/botostubs
- Owner: boto
- License: apache-2.0
- Created: 2019-07-14T20:00:23.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-20T01:14:59.000Z (over 3 years ago)
- Last Synced: 2024-08-04T01:26:28.946Z (4 months ago)
- Language: Python
- Size: 630 KB
- Stars: 51
- Watchers: 8
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Boto Stubs
==========This repo contains a generator that produces type hints for botocore as well as
the generated output. These type hints can be used both for the purpose of
static type analysis and for dot completion support. The latter is relevant
because botocore's classes don't exist until runtime, and therefore IDEs cannot
know all the methods that will be available without this... note::
This project is currently a work in-progress and is not yet intended for
production.Installation / Usage
--------------------To make use of the type hints, install the ``botocore-stubs`` package. mypy
will automatically pick up on the type hints for botocore, even without
expclitit annotations in your code. Other tools compatible with PEP561_ style
packages should also work.Currently only botocore is supported. If you are using boto3 you will need to
annotate your calls to ``boto3.client`` like so::s3 = boto3.client('s3') # type: botocore.client.S3
There is a known issue where boto3-specific methods, such as ``upload_file``
are not present in the stub files.Development
-----------This project uses black_ and pre-commit_ to enforce sytle on python code. On
macOS you can do the following to get started::brew install pre-commit
pre-commit installThat will set up the hooks to run black on every commit.
Structure
~~~~~~~~~This repo contains multiple packages:
* ``botocore-stubs`` is the stubs-only package that provides type hints for
botocore. Most of it is generated code.
* ``botogen`` is the code generator for the stubs packages.When boto3 support is added, it will be under its own package, ``boto3-stubs``.
.. _black: https://github.com/python/black
.. _pre-commit: https://pre-commit.com/
.. _PEP561: https://www.python.org/dev/peps/pep-0561/