Registry / type-stubs / mypy-boto3-athena

mypy-boto3-athena

JSON →
library1.43.0pypypi✓ verified 23d ago

mypy-boto3-athena provides PEP 561 compliant type annotations (stubs) for the boto3 Athena service. It allows static type checkers like MyPy to validate usage of boto3's Athena client, improving code quality and catching errors early. The package is generated by mypy-boto3-builder, and its releases are frequent, typically mirroring boto3 updates and builder enhancements. Current version is 1.42.43.

pip install mypy-boto3-athena
INSTALL
IMPORT
SIG · MYPY-BOTO3-ATHENA
M
mypy-boto3-athena
type-stubspythonv1.43.0
Install
2.7s avg
Import
Disk
71MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.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.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.5MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.7s · import 0.000s · 19MB
71MB installed
● package 71MB
Code
Verified usage

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

AthenaClient
from mypy_boto3_athena import AthenaClient
from mypy_boto3_athena import AthenaClient

This quickstart demonstrates how to initialize an Athena client with type annotations from `mypy-boto3-athena` and define input parameters using TypeDefs, enabling static type checking for your boto3 calls. It assumes `boto3` is already installed and configured with AWS credentials.

import boto3 from mypy_boto3_athena.client import AthenaClient from mypy_boto3_athena.type_defs import StartQueryExecutionInputRequestTypeDef import os # Instantiate a boto3 Athena client with type annotations def get_athena_client() -> AthenaClient: return boto3.client("athena", region_name=os.environ.get('AWS_REGION', 'us-east-1')) client: AthenaClient = get_athena_client() # Define input using a TypeDef for static checking query_execution_input: StartQueryExecutionInputRequestTypeDef = { "QueryString": "SELECT 1 FROM \"AwsDataCatalog\".\"default\".\"test_table\" LIMIT 1;", "WorkGroup": os.environ.get('ATHENA_WORKGROUP', 'primary'), "ResultConfiguration": { "OutputLocation": os.environ.get('ATHENA_OUTPUT_LOCATION', 's3://your-athena-results-bucket/'), }, } print(f"Client type: {type(client)}") print("Type checking for Athena operations is now enabled.") # Example of a type-checked call (uncomment to run, requires valid AWS setup) # try: # response = client.start_query_execution(**query_execution_input) # print(f"Query Execution ID: {response['QueryExecutionId']}") # except Exception as e: # print(f"Error starting query (ensure AWS_REGION, ATHENA_WORKGROUP, ATHENA_OUTPUT_LOCATION are set and valid): {e}")
Debug
Known issues
breakingPython 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. All `mypy-boto3` packages built with this builder or later will require Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0 (and dependent mypy-boto3-* packages)
breakingMigration to PEP 561 packages in `mypy-boto3-builder` version 8.12.0 changes the internal structure and how type checkers locate stubs. While user-facing imports are generally stable, some tooling or custom MyPy configurations might require adjustments.
fix
Ensure your MyPy version is up-to-date and that your environment correctly resolves PEP 561-compliant stub packages. For most users, this change is transparent.
affects: mypy-boto3-builder >= 8.12.0 (and dependent mypy-boto3-* packages)
gotchaThis package provides only type stubs, not the functional `boto3` library itself. You must explicitly install `boto3` (e.g., `pip install boto3`) for your code to run.
fix
Always install `boto3` alongside `mypy-boto3-athena`.
affects: All versions
breakingIn `mypy-boto3-builder` version 8.9.0, TypeDef naming conventions were updated. This included shortening duplicated 'Request' suffixes (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving 'Extra' postfixes. If you directly imported specific TypeDefs, their names might have changed.
fix
Consult the `mypy-boto3` documentation or regenerate your code's type hints to reflect the new TypeDef names. Your IDE's autocomplete can often help identify the correct names.
affects: mypy-boto3-builder >= 8.9.0 (and dependent mypy-boto3-* packages)
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3's Athena client. The actual boto3 library must be installed separately to run the code.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
mypy-boto3-athena — pip install mypy-boto3-athena · libregistry