{"id":21823,"library":"pythena","title":"PyThenA - Simple Athena Wrapper","description":"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.","status":"active","version":"1.6.0","language":"python","source_language":"en","source_url":"https://github.com/chrispruitt/pythena","tags":["aws","athena","query","boto3","wrapper"],"install":[{"cmd":"pip install pythena","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for AWS Athena client","package":"boto3","optional":false}],"imports":[{"note":"Correct import path","wrong":"","symbol":"PyThenA","correct":"from pythena import PyThenA"}],"quickstart":{"code":"from pythena import PyThenA\nimport os\n\ndatabase = os.environ.get('ATHENA_DATABASE', 'default')\nquery = \"SELECT 1 AS test\"\n\nclient = PyThenA(database=database)\nresult = client.execute(query)\nprint(result.data)","lang":"python","description":"Basic usage: create PyThenA instance with database, execute query, access result.data as a list of dicts."},"warnings":[{"fix":"Access result.data for query results.","message":"The execute() method returns a Result object with .data (list of dicts) and .columns (list of column names). Do not expect raw dicts directly.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using boto3 directly or awswrangler for Athena queries.","message":"The library has not been updated since 2021. boto3 API changes may cause incompatibility with newer AWS API versions.","severity":"deprecated","affected_versions":">=1.6.0"},{"fix":"client = PyThenA(database='mydb', output_location='s3://my-bucket/path/')","message":"The 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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-06':31 '-28':32 '1.6.0':27 '2021':30 'amazon':7 'athena':3,8,37 'aw':36 'boto3':11,39 'current':25 'databas':21 'execut':13 'last':28 'leverag':10 'pythena':1 'queri':14,23,38 'recent':34 'releas':35 'requir':18 'result':17 'return':16 'simpl':2,6 'string':24 'updat':29 'version':26 'wrapper':4,9,40","created_at":"2026-04-27T17:01:55.048711+00:00","updated_at":"2026-04-27T17:01:55.048711+00:00","problems":{"verify_error":"/tmp/tmpwrm1hmks/venv/lib/python3.12/site-packages/pythena/Athena.py:23: SyntaxWarning: invalid escape sequence '\\/'\n  __s3_path_regex = '^s3:\\/\\/[a-zA-Z0-9.\\-_\\/]*$'\nTraceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'PyThenA' from 'pythena' (/"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.6.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/chrispruitt/pythena","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pythena/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-09","install_tag":null}}