Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
.. |ci badge| image:: https://github.com/aio-libs/aiobotocore/actions/workflows/ci-cd.yml/badge.svg?branch=master :target: https://github.com/aio-libs/aiobotocore/actions/workflows/ci-cd.yml :alt: CI status of master branch .. |pre-commit badge| image:: https://results.pre-commit.ci/badge/github/aio-libs/aiobotocore/master.svg :target: https://results.pre-commit.ci/latest/github/aio-libs/aiobotocore/master :alt: pre-commit.ci status .. |coverage badge| image:: https://codecov.io/gh/aio-libs/aiobotocore/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/aiobotocore :alt: Coverage status on master branch .. |docs badge| image:: https://readthedocs.org/projects/aiobotocore/badge/?version=latest :target: https://aiobotocore.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status .. |pypi badge| image:: https://img.shields.io/pypi/v/aiobotocore.svg :target: https://pypi.python.org/pypi/aiobotocore :alt: Latest version on pypi .. |gitter badge| image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/aio-libs/aiobotocore :alt: Chat on Gitter .. |pypi downloads badge| image:: https://img.shields.io/pypi/dm/aiobotocore.svg?label=PyPI%20downloads :target: https://pypi.org/project/aiobotocore/ :alt: Downloads Last Month .. |conda badge| image:: https://img.shields.io/conda/dn/conda-forge/aiobotocore.svg?label=Conda%20downloads :target: https://anaconda.org/conda-forge/aiobotocore :alt: Conda downloads .. |stackoverflow badge| image:: https://img.shields.io/badge/stackoverflow-Ask%20questions-blue.svg :target: https://stackoverflow.com/questions/tagged/aiobotocore :alt: Stack Overflow
|ci badge| |pre-commit badge| |coverage badge| |docs badge| |pypi badge| |gitter badge| |pypi downloads badge| |conda badge| |stackoverflow badge|
Async client for amazon services using botocore_ and aiohttp_/asyncio_.
This library is a mostly full featured asynchronous version of botocore.
::
$ pip install aiobotocore
.. code:: python
import asyncio
from aiobotocore.session import get_session
AWS_ACCESS_KEY_ID = "xxx"
AWS_SECRET_ACCESS_KEY = "xxx"
async def go():
bucket = 'dataintake'
filename = 'dummy.bin'
folder = 'aiobotocore'
key = '{}/{}'.format(folder, filename)
session = get_session()
async with session.create_client('s3', region_name='us-west-2',
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
aws_access_key_id=AWS_ACCESS_KEY_ID) as client:
# upload object to amazon s3
data = b'\x01'*1024
resp = await client.put_object(Bucket=bucket,
Key=key,
Body=data)
print(resp)
# getting s3 object properties of file we just uploaded
resp = await client.get_object_acl(Bucket=bucket, Key=key)
print(resp)
# get object from s3
response = await client.get_object(Bucket=bucket, Key=key)
# this will ensure the connection is correctly re-used/closed
async with response['Body'] as stream:
assert await stream.read() == data
# list s3 objects using paginator
paginator = client.get_paginator('list_objects')
async for result in paginator.paginate(Bucket=bucket, Prefix=folder):
for c in result.get('Contents', []):
print(c)
# delete object from s3
resp = await client.delete_object(Bucket=bucket, Key=key)
print(resp)
loop = asyncio.get_event_loop()
loop.run_until_complete(go())
.. code:: python
from contextlib import AsyncExitStack
from aiobotocore.session import AioSession
# How to use in existing context manager
class Manager:
def __init__(self):
self._exit_stack = AsyncExitStack()
self._s3_client = None
async def __aenter__(self):
session = AioSession()
self._s3_client = await self._exit_stack.enter_async_context(session.create_client('s3'))
async def __aexit__(self, exc_type, exc_val, exc_tb):
await self._exit_stack.__aexit__(exc_type, exc_val, exc_tb)
# How to use with an external exit_stack
async def create_s3_client(session: AioSession, exit_stack: AsyncExitStack):
# Create client and add cleanup
client = await exit_stack.enter_async_context(session.create_client('s3'))
return client
async def non_manager_example():
session = AioSession()
async with AsyncExitStack() as exit_stack:
s3_client = await create_s3_client(session, exit_stack)
# do work with s3_client
This is a non-exuastive list of what tests aiobotocore runs against AWS services. Not all methods are tested but we aim to test the majority of commonly used methods.
+----------------+-----------------------+ | Service | Status | +================+=======================+ | S3 | Working | +----------------+-----------------------+ | DynamoDB | Basic methods tested | +----------------+-----------------------+ | SNS | Basic methods tested | +----------------+-----------------------+ | SQS | Basic methods tested | +----------------+-----------------------+ | CloudFormation | Stack creation tested | +----------------+-----------------------+ | Kinesis | Basic methods tested | +----------------+-----------------------+
Due to the way boto3 is implemented, its highly likely that even if services are not listed above that you can take any boto3.client('service')
and
stick await
in front of methods to make them async, e.g. await client.list_named_queries()
would asynchronous list all of the named Athena queries.
If a service is not listed here and you could do with some tests or examples feel free to raise an issue.
There are two set of tests, those that can be mocked through moto <https://github.com/getmoto/moto>
_ running in docker, and those that require running against a personal amazon key. The CI only runs the moto tests.
To run the moto tests:
::
$ make mototest
To run the non-moto tests:
Make sure you have development requirements installed and your amazon key and secret accessible via environment variables:
::
$ pip install pip-tools
$ pip-compile --all-extras pyproject.toml
$ pip-sync
$ pip install -e ".[awscli,boto3]"
$ export AWS_ACCESS_KEY_ID=xxx
$ export AWS_SECRET_ACCESS_KEY=xxx
$ export AWS_DEFAULT_REGION=xxx # e.g. us-west-2
Execute tests suite:
::
$ make test
Install types-aiobotocore_ that contains type annotations for aiobotocore
and all supported botocore_ services.
.. code:: bash
# install aiobotocore type annotations
# for ec2, s3, rds, lambda, sqs, dynamo and cloudformation
python -m pip install 'types-aiobotocore[essential]'
# or install annotations for services you use
python -m pip install 'types-aiobotocore[acm,apigateway]'
# Lite version does not provide session.create_client overloads
# it is more RAM-friendly, but requires explicit type annotations
python -m pip install 'types-aiobotocore-lite[essential]'
Now you should be able to run Pylance_, pyright_, or mypy_ for type checking as well as code completion in your IDE.
For types-aiobotocore-lite
package use explicit type annotations:
.. code:: python
from aiobotocore.session import get_session
from types_aiobotocore_s3.client import S3Client
session = get_session()
async with session.create_client("s3") as client:
client: S3Client
# type checking and code completion is now enabled for client
Full documentation for types-aiobotocore
can be found here: https://youtype.github.io/types_aiobotocore_docs/
.. _Python: https://www.python.org .. _asyncio: https://docs.python.org/3/library/asyncio.html .. _botocore: https://github.com/boto/botocore .. _aiohttp: https://github.com/aio-libs/aiohttp .. _types-aiobotocore: https://youtype.github.io/types_aiobotocore_docs/ .. _Pylance: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance .. _pyright: https://github.com/microsoft/pyright .. _mypy: http://mypy-lang.org/
awscli and boto3 depend on a single version, or a narrow range of versions, of botocore. However, aiobotocore only supports a specific range of botocore versions. To ensure you install the latest version of awscli and boto3 that your specific combination or aiobotocore and botocore can support use::
pip install -U 'aiobotocore[awscli,boto3]'
If you only need awscli and not boto3 (or vice versa) you can just install one extra or the other.
2.16.0 (2024-12-16) ^^^^^^^^^^^^^^^^^^^
2.15.2 (2024-10-09) ^^^^^^^^^^^^^^^^^^^
2.15.1 (2024-09-19) ^^^^^^^^^^^^^^^^^^^
2.15.0 (2024-09-10) ^^^^^^^^^^^^^^^^^^^
2.14.0 (2024-08-28) ^^^^^^^^^^^^^^^^^^^
2.13.3 (2024-08-22) ^^^^^^^^^^^^^^^^^^^
create_waiter_with_client()
2.13.2 (2024-07-18) ^^^^^^^^^^^^^^^^^^^
2.13.1 (2024-06-24) ^^^^^^^^^^^^^^^^^^^
2.13.0 (2024-05-16) ^^^^^^^^^^^^^^^^^^^
aiohttp==3.9.2
#8822.12.4 (2024-05-16) ^^^^^^^^^^^^^^^^^^^
2.12.3 (2024-04-11) ^^^^^^^^^^^^^^^^^^^
2.12.2 (2024-04-01) ^^^^^^^^^^^^^^^^^^^
http_session_cls
in AioConfig
2.12.1 (2024-03-04) ^^^^^^^^^^^^^^^^^^^
2.12.0 (2024-02-28) ^^^^^^^^^^^^^^^^^^^
2.11.2 (2024-02-02) ^^^^^^^^^^^^^^^^^^^
2.11.1 (2024-01-25) ^^^^^^^^^^^^^^^^^^^
2.11.0 (2024-01-19) ^^^^^^^^^^^^^^^^^^^
User-Agent
HTTP header #8532.10.0 (2024-01-18) ^^^^^^^^^^^^^^^^^^^
2.9.1 (2024-01-17) ^^^^^^^^^^^^^^^^^^
2.9.0 (2023-12-12) ^^^^^^^^^^^^^^^^^^
2.8.0 (2023-11-28) ^^^^^^^^^^^^^^^^^^
aiobotocore.session.Session
symbol2.7.0 (2023-10-17) ^^^^^^^^^^^^^^^^^^
2.6.0 (2023-08-11) ^^^^^^^^^^^^^^^^^^
2.5.4 (2023-08-07) ^^^^^^^^^^^^^^^^^^
2.5.3 (2023-08-06) ^^^^^^^^^^^^^^^^^^
2.5.2 (2023-07-06) ^^^^^^^^^^^^^^^^^^
2.5.1 (2023-06-27) ^^^^^^^^^^^^^^^^^^
2.5.0 (2023-03-06) ^^^^^^^^^^^^^^^^^^
2.4.2 (2022-12-22) ^^^^^^^^^^^^^^^^^^
2.4.1 (2022-11-28) ^^^^^^^^^^^^^^^^^^
2.4.0 (2022-08-25) ^^^^^^^^^^^^^^^^^^
2.3.4 (2022-06-23) ^^^^^^^^^^^^^^^^^^
2.3.3 (2022-06-07) ^^^^^^^^^^^^^^^^^^
2.3.2 (2022-05-08) ^^^^^^^^^^^^^^^^^^
2.3.1 (2022-05-06) ^^^^^^^^^^^^^^^^^^
2.3.0 (2022-05-05) ^^^^^^^^^^^^^^^^^^
2.2.0 (2022-03-16) ^^^^^^^^^^^^^^^^^^
2.1.2 (2022-03-03) ^^^^^^^^^^^^^^^^^^
2.1.1 (2022-02-10) ^^^^^^^^^^^^^^^^^^
2.1.0 (2021-12-14) ^^^^^^^^^^^^^^^^^^
2.0.1 (2021-11-25) ^^^^^^^^^^^^^^^^^^
2.0.0 (2021-11-02) ^^^^^^^^^^^^^^^^^^
AIOBOTOCORE_DEPRECATED_1_4_0_APIS
env var to match botocore module. See notes in 1.4.0.1.4.2 (2021-09-03) ^^^^^^^^^^^^^^^^^^
@terrycain <https://github.com/terrycain>
_)1.4.1 (2021-08-24) ^^^^^^^^^^^^^^^^^^
AIOBOTOCORE_DEPRECATED_1_4_0_APIS
env var. This means that #876 <https://github.com/aio-libs/aiobotocore/issues/876>
_ will not work unless this env var has been set to 0.1.4.0 (2021-08-20) ^^^^^^^^^^^^^^^^^^
#877 <https://github.com/aio-libs/aiobotocore/pull/877>
_mappings <https://github.com/aio-libs/aiobotocore/pull/877/files#diff-b1675e1eb4276bfae81107cda919ba446e4ce1b1e228a9e878d65dd1f474bf8cR162-R181>
_1.3.3 (2021-07-12) ^^^^^^^^^^^^^^^^^^
#872 <https://github.com/aio-libs/aiobotocore/issues/872>
_1.3.2 (2021-07-07) ^^^^^^^^^^^^^^^^^^
1.20.106 <https://github.com/boto/botocore/tree/1.20.106>
_1.3.1 (2021-06-11) ^^^^^^^^^^^^^^^^^^
#868 <https://github.com/aio-libs/aiobotocore/issues/868>
_1.3.0 (2021-04-09) ^^^^^^^^^^^^^^^^^^
1.20.49 <https://github.com/boto/botocore/tree/1.20.49>
_ #856 <https://github.com/aio-libs/aiobotocore/pull/856>
_1.2.2 (2021-03-11) ^^^^^^^^^^^^^^^^^^
#858 <https://github.com/aio-libs/aiobotocore/pull/858>
(thanks @puzza007 <https://github.com/puzza007>
_)1.2.1 (2021-02-10) ^^^^^^^^^^^^^^^^^^
#851 <https://github.com/aio-libs/aiobotocore/pull/851>
_ (thanks @FHTMitchell <https://github.com/FHTMitchell>
_)1.2.0 (2021-01-11) ^^^^^^^^^^^^^^^^^^
1.19.52 <https://github.com/boto/botocore/tree/1.19.52>
_#797 <https://github.com/aio-libs/aiobotocore/issues/797>
_1.1.2 (2020-10-07) ^^^^^^^^^^^^^^^^^^
@joseph-jones <https://github.com/joseph-jones>
_)1.1.1 (2020-08-31) ^^^^^^^^^^^^^^^^^^
1.1.0 (2020-08-18) ^^^^^^^^^^^^^^^^^^
1.0.7 (2020-06-04) ^^^^^^^^^^^^^^^^^^
1.0.6 (2020-06-04) ^^^^^^^^^^^^^^^^^^
1.0.5 (2020-06-03) ^^^^^^^^^^^^^^^^^^
1.0.4 (2020-04-15) ^^^^^^^^^^^^^^^^^^
1.0.3 (2020-04-09) ^^^^^^^^^^^^^^^^^^
1.0.2 (2020-04-05) ^^^^^^^^^^^^^^^^^^
1.0.1 (2020-04-01) ^^^^^^^^^^^^^^^^^^
1.0.0 (2020-03-31) ^^^^^^^^^^^^^^^^^^
0.12.0 (2020-02-23) ^^^^^^^^^^^^^^^^^^^
0.11.1 (2020-01-03) ^^^^^^^^^^^^^^^^^^^
0.11.0 (2019-11-12) ^^^^^^^^^^^^^^^^^^^
0.10.4 (2019-10-24) ^^^^^^^^^^^^^^^^^^^
0.10.3 (2019-07-17) ^^^^^^^^^^^^^^^^^^^
0.10.2 (2019-02-11) ^^^^^^^^^^^^^^^^^^^
0.10.1 (2019-02-08) ^^^^^^^^^^^^^^^^^^^
0.10.0 (2018-12-09) ^^^^^^^^^^^^^^^^^^^
0.9.4 (2018-08-08) ^^^^^^^^^^^^^^^^^^
0.9.3 (2018-07-16) ^^^^^^^^^^^^^^^^^^
0.9.2 (2018-05-05) ^^^^^^^^^^^^^^^^^^
0.9.1 (2018-05-04) ^^^^^^^^^^^^^^^^^^
0.9.0 (2018-06-01) ^^^^^^^^^^^^^^^^^^
0.8.0 (2018-05-07) ^^^^^^^^^^^^^^^^^^
0.7.0 (2018-05-01) ^^^^^^^^^^^^^^^^^^
0.6.1a0 (2018-05-01) ^^^^^^^^^^^^^^^^^^^^
0.6.0 (2018-03-04) ^^^^^^^^^^^^^^^^^^
0.5.3 (2018-02-23) ^^^^^^^^^^^^^^^^^^
0.5.2 (2017-12-06) ^^^^^^^^^^^^^^^^^^
0.5.1 (2017-11-10) ^^^^^^^^^^^^^^^^^^
0.5.0 (2017-11-10) ^^^^^^^^^^^^^^^^^^
0.4.5 (2017-09-05) ^^^^^^^^^^^^^^^^^^
0.4.4 (2017-08-16) ^^^^^^^^^^^^^^^^^^
0.4.3 (2017-07-05) ^^^^^^^^^^^^^^^^^^
0.4.2 (2017-07-03) ^^^^^^^^^^^^^^^^^^
0.4.1 (2017-06-27) ^^^^^^^^^^^^^^^^^^
0.4.0 (2017-06-19) ^^^^^^^^^^^^^^^^^^
0.3.3 (2017-05-22) ^^^^^^^^^^^^^^^^^^
0.3.2 (2017-05-22) ^^^^^^^^^^^^^^^^^^
0.3.1 (2017-04-18) ^^^^^^^^^^^^^^^^^^
0.3.0 (2017-04-01) ^^^^^^^^^^^^^^^^^^
0.2.3 (2017-03-22) ^^^^^^^^^^^^^^^^^^
0.2.2 (2017-03-07) ^^^^^^^^^^^^^^^^^^
0.2.1 (2017-02-01) ^^^^^^^^^^^^^^^^^^
0.2.0 (2017-01-30) ^^^^^^^^^^^^^^^^^^
max_pool_connections
property (note default is 10)0.1.1 (2017-01-16) ^^^^^^^^^^^^^^^^^^
0.1.0 (2017-01-12) ^^^^^^^^^^^^^^^^^^
0.0.6 (2016-11-19) ^^^^^^^^^^^^^^^^^^
0.0.5 (2016-06-01) ^^^^^^^^^^^^^^^^^^
FAQs
Async client for aws services using botocore and aiohttp
We found that aiobotocore demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.