PyAthena
Python DB API 2.0 (PEP 249) client for Amazon Athena
Decision gist · record as of 2026-08-14
Yes, if you need to query S3 data via SQL from Python. PyAthena is actively maintained, has no known vulnerabilities, low install friction, and provides a standard DB API interface. The permissive MIT license poses no restrictions. Install it if you're already using Athena; skip it if you don't have AWS infrastructure or prefer direct boto3 calls.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- AWS credentials must be configured (via boto3) and you must have an S3 bucket for staging query results.
- Low install friction with a pure-Python wheel.
- Actively maintained with a release 14 days ago and last commit on 2026-08-11.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) — you can use, modify, and distribute PyAthena freely in commercial and private projects with minimal restrictions.
last release 2026-07-31 (14 days) · last repo commit 2026-08-11 · 492 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 24,458,508 downloads/mo, #918 on PyPI
Alternatives
Verify before relying
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.fetchall())- Whether optional extras (SQLAlchemy, Pandas, Polars, Arrow) are commonly used or niche.
- Performance characteristics and query timeout behavior compared to direct AWS SDK usage.
- Support for Athena-specific features like workgroups, result reuse, or query cost controls.
What it is and what it does
PyAthena wraps Amazon Athena's API in a standard Python DB API 2.0 interface, letting you run SQL queries against data stored in S3 without managing a database server. It depends on boto3 and botocore for AWS authentication and communication, fsspec for S3 filesystem abstraction, python-dateutil for timestamp handling, and tenacity for automatic retry logic on transient failures.
The package supports both blocking (synchronous) queries via `connect()` and native asyncio queries via `aio_connect()`, making it suitable for both traditional scripts and async applications. Query results are staged to S3 before retrieval, so you need an S3 bucket and valid AWS credentials configured. Optional extras allow integration with SQLAlchemy, Pandas, Polars, and Arrow for data transformation workflows.
Use it for
- Run ad-hoc SQL queries against S3 data lakes without provisioning a data warehouse.
- Integrate Athena queries into Python ETL pipelines using the standard DB API interface.
- Load query results directly into Pandas or Polars DataFrames for analysis.
- Build async applications that query Athena without blocking the event loop.
- Use SQLAlchemy ORM or query builder with Athena as a backend.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to query S3 data via SQL from Python.
PyAthena is actively maintained, has no known vulnerabilities, low install friction, and provides a standard DB API interface. The permissive MIT license poses no restrictions. Install it if you're already using Athena; skip it if you don't have AWS infrastructure or prefer direct boto3 calls.
Install
pyathena on PyPI
Before you install
Low install friction with a pure-Python wheel. Actively maintained with a release 14 days ago and last commit on 2026-08-11. Supports Python 3.10 through 3.14.
AWS credentials must be configured (via boto3) and you must have an S3 bucket for staging query results.
License in practice
MIT license (permissive) — you can use, modify, and distribute PyAthena freely in commercial and private projects with minimal restrictions.
Quickstart
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.fetchall())
Verify before relying
- Whether optional extras (SQLAlchemy, Pandas, Polars, Arrow) are commonly used or niche.
- Performance characteristics and query timeout behavior compared to direct AWS SDK usage.
- Support for Athena-specific features like workgroups, result reuse, or query cost controls.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagesboto3botocorefsspecpython-dateutiltenacity |
| Maintenance | Actively maintained 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 24,458,508 / month, #918 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Database :: Front-Ends |
Evidence: pyathena-3.35.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “amazon athena sql client”
- PyAthenaPyAthena is a Python DB API 2.0 client for Amazon Athena that lets…
- pyathenajdbcPyAthenaJDBC wraps the Amazon Athena JDBC driver to provide a Python…
- dbt-athenadbt-athena is a dbt adapter that enables data transformation…
Give your agent the search over MCP, or paste the wish link into any chat.
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object Relational Mapper (ORM) that provides both a high-level ORM layer for declarative object persistence and a Core SQL construction system for direct database abstraction and query building.
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Alembic generates and manages database schema migrations for SQLAlchemy applications, handling version control of database structure changes with support for upgrades, downgrades, and auto-generation from model changes.
Install it if you use SQLAlchemy and need to version-control schema changes; skip it only if you manage migrations manually or use a different ORM entirely.
A Python client library for connecting to and querying Weaviate, a vector database that enables semantic search and AI-powered data retrieval.
A Python client library that connects to Databricks clusters and SQL warehouses using a Thrift-based protocol, conforming to the Python DB API 2.0 specification and supporting Arrow-based data exchange.
Install it if you need to query Databricks clusters or SQL warehouses from Python.
Psycopg 3 is a PostgreSQL database adapter for Python that enables applications to connect to, query, and manage PostgreSQL databases using Python code.
Install it if you need to connect Python to PostgreSQL.
See also pyathenajdbc · pythena · pydynamodb · dbt-athena · dbt-athena-community · awswrangler · redshift-connector · PyHive · hdbcli