Skip to main content

PyAthena

PyAthena logo

PyPI - Version PyPI - Python Version PyPI - Downloads CI - Test CD - Docs License - MIT linting - Ruff types - Mypy

PyAthena is a Python DB API 2.0 (PEP 249) client for Amazon Athena. It runs queries on Athena engine version 3 and on Athena DuckDB.


Requirements

  • Python

    • CPython 3.11, 3.12, 3.13, 3.14, 3.15

Installation

$ pip install PyAthena

Extra packages:

Package Install command Version
SQLAlchemy pip install PyAthena[SQLAlchemy] >=2.0.52
AioSQLAlchemy pip install PyAthena[AioSQLAlchemy] >=2.0.52
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

MIT 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.

The PyAthena logo was generated using Nano-Banana Pro (Gemini 3 Pro Image).

Metadata

Release files for PyAthena 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyAthena 5.0.0
File Size Uploaded Provenance Actions
pyathena-5.0.0.tar.gz 526.9 kB With provenance Details for pyathena-5.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyAthena 5.0.0
File Interpreter ABI Platform Actions
pyathena-5.0.0-py3-none-any.whl Python 3 none any Details for pyathena-5.0.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / pyathena-5.0.0.tar.gz

Download URL pyathena-5.0.0.tar.gz
Size 526.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cc5fb84634359e1a1f50c5c6e9db0b2e51ec97df119309af9a72621d3a4046ec
BLAKE2b-256 checksum
How to use checksums
c5f21d1160ad8b5e68fde614febbabb53cc0dbc92ba9d176c31c51844a5f2a9a
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 Dec 4, 2026.

Transparency log

Release files / pyathena-5.0.0-py3-none-any.whl

Download URL pyathena-5.0.0-py3-none-any.whl
Size 613.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e07f2b33d4fb6749c248122ab704dd8b7a90ff5d40f2e8573b7be2792cde59b9
BLAKE2b-256 checksum
How to use checksums
56c3a256b22ea69fd25fc562a01fb4f6c7ce426337a9791c4e1ec44dd336218e
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 Dec 4, 2026.

Transparency log

Security for PyAthena 5.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyathena-5.0.0.tar.gz

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 Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page