Registry / aws / pythena

pythena

JSON →
library1.6.0pypypiunverified

A simple Amazon Athena wrapper leveraging boto3 to execute queries and return results. Requires only a database and query string. Current version 1.6.0, last updated 2021-06-28, no recent releases.

pip install pythena
INSTALL
IMPORT
SIG · PYTHENA
P
pythena
awspythonv1.6.0
Install
10.2s avg
Import
—
Disk
197MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.6.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 197MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 10.2s · import 0.000s · 190MB
197MB installed
● package 197MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PyThenA
✓ from pythena import PyThenA
Correct import path

Basic usage: create PyThenA instance with database, execute query, access result.data as a list of dicts.

from pythena import PyThenA import os database = os.environ.get('ATHENA_DATABASE', 'default') query = "SELECT 1 AS test" client = PyThenA(database=database) result = client.execute(query) print(result.data)
Debug
Known issues
gotchaThe execute() method returns a Result object with .data (list of dicts) and .columns (list of column names). Do not expect raw dicts directly.
fix
Access result.data for query results.
affects: all
deprecatedThe library has not been updated since 2021. boto3 API changes may cause incompatibility with newer AWS API versions.
fix
Consider using boto3 directly or awswrangler for Athena queries.
affects: >=1.6.0
gotchaThe PyThenA constructor defaults to 'default' output location 's3://aws-athena-query-results-{account_id}-{region}/'. If your bucket has a different pattern, set output_location explicitly.
fix
client = PyThenA(database='mydb', output_location='s3://my-bucket/path/')
affects: all
Upgrade
Version history
1.6.0latest on PyPI · released Sep 15, 2020
Audit
Dependencies
boto3requiredRequired for AWS Athena client
Agent activity
38 hits · last 30 days
node
26
Resources
pythena — pip install pythena · libregistry