PyAthena
PyAthena is a Python DB API 2.0 (PEP 249) client for Amazon Athena.
Requirements
-
Python
- CPython 3.11, 3.12, 3.13, 3.14
Installation
$ pip install PyAthena
Extra packages:
| Package | Install command | Version |
|---|---|---|
| SQLAlchemy | pip install PyAthena[SQLAlchemy] |
>=2.0.0 |
| AioSQLAlchemy | pip install PyAthena[AioSQLAlchemy] |
>=2.0.0 |
| Pandas | pip install PyAthena[Pandas] |
>=3.0.0 |
| Arrow | pip install PyAthena[Arrow] |
>=22.0.0 |
| Polars | pip install PyAthena[Polars] |
>=1.39.0 |
Usage
from pyathena import connect
cursor = connect(s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/",
region_name="us-west-2").cursor()
cursor.execute("SELECT * FROM one_row")
print(cursor.description)
print(cursor.fetchall())
Native asyncio is also supported:
import asyncio
from pyathena import aio_connect
async def main():
async with await aio_connect(s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/",
region_name="us-west-2") as conn:
cursor = conn.cursor()
await cursor.execute("SELECT 1")
print(await cursor.fetchone())
asyncio.run(main())
Contributing
Contributions, including AI-assisted contributions, are welcome. Please read CONTRIBUTING.md before starting a change.
License
PyAthena's early development was informed by PyHive, including its DB-API tests and implementation patterns. PyAthena has since evolved with substantial Athena-specific functionality and additional backends. See NOTICE for acknowledgements.
Links
- Documentation: https://pyathena.dev/
- PyPI Releases: https://pypi.org/project/PyAthena/
- Source Code: https://github.com/pyathena-dev/PyAthena/
- Issue Tracker: https://github.com/pyathena-dev/PyAthena/issues
Logo
The PyAthena logo was generated using Nano-Banana Pro (Gemini 3 Pro Image).
Metadata
Release files for PyAthena 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyathena-4.1.0.tar.gz | 280.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyathena-4.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 634.5 kB
Release files / pyathena-4.1.0.tar.gz
| Download URL | pyathena-4.1.0.tar.gz |
|---|---|
| Size | 280.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
857b5c8ac692a1fe9a3772ccfa7c92f4cf70ac87ac63e8b545a6b717ab55f29f
|
|
BLAKE2b-256 checksum How to use checksums |
663bf48e053daf4dbbade6247cc144e00660e66c3131a7cb88daebe05d6ff520
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / pyathena-4.1.0-py3-none-any.whl
| Download URL | pyathena-4.1.0-py3-none-any.whl |
|---|---|
| Size | 354.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
522b80843148378e04598a29da4b187142e08c7e187efd8a343f1dfcb41a118a
|
|
BLAKE2b-256 checksum How to use checksums |
c40398051ffd9f2eb69daaf14a783e5e9d35a20fa683f83e15bfe4227c493191
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log