Type Annotations for boto3 TimestreamInfluxDB
mypy-boto3-timestream-influxdb provides type annotations for the AWS boto3 TimestreamInfluxDB service, enhancing developer experience with static type checking for improved code quality and autocompletion. It is currently at version 1.42.77 and releases frequently, often in sync with new boto3/botocore versions or updates to the `mypy-boto3-builder`.
Warnings
- breaking Support for Python 3.8 was removed in `mypy-boto3-builder` version 8.12.0 (and subsequently in generated stub packages like this one). Projects using Python 3.8 will need to upgrade to Python 3.9 or newer.
- gotcha This library provides only type stubs. You must still `pip install boto3` (or `aiobotocore`/`aioboto3` for async variants) separately to use the AWS SDK for Python at runtime. `mypy-boto3` packages do not include the runtime dependencies.
- breaking In `mypy-boto3-builder` version 8.9.0, there were changes to how TypeDef names are generated, specifically for method arguments and when resolving naming conflicts (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`). This might cause `NameError` if your code explicitly references these type definitions.
- gotcha Service names can change or be deprecated (e.g., `sms-voice` was replaced by `pinpoint-sms-voice` in `mypy-boto3-builder` 8.11.0). If you encounter `ModuleNotFoundError` or type-checking issues after updating, verify the exact service name and availability for the `boto3` client and the `mypy-boto3` stub package.
- gotcha As of `mypy-boto3-builder` 8.12.0, all packages migrated to PEP 561. While this is generally transparent for most users, it might affect custom packaging, build systems, or very specific type checker configurations that rely on older module discovery mechanisms.
Install
-
pip install mypy-boto3-timestream-influxdb
Imports
- TimestreamInfluxDBClient
from mypy_boto3_timestream_influxdb import TimestreamInfluxDBClient
- TagTypeDef
from mypy_boto3_timestream_influxdb.type_defs import TagTypeDef
Quickstart
import boto3
from mypy_boto3_timestream_influxdb import TimestreamInfluxDBClient
from mypy_boto3_timestream_influxdb.type_defs import CreateInfluxDBInstanceInputRequestTypeDef
import os
# The actual client is from boto3, mypy-boto3 provides the type hint
client: TimestreamInfluxDBClient = boto3.client(
"timestream-influxdb",
region_name=os.environ.get('AWS_REGION', 'us-east-1')
)
# Example of using a typed client method (hypothetical, as actual calls depend on service API)
try:
# This is a placeholder call, replace with an actual TimestreamInfluxDB operation
# to test type hints, e.g., client.list_influx_db_instances()
# We'll use a type definition for demonstration.
instance_config: CreateInfluxDBInstanceInputRequestTypeDef = {
"name": "my-test-instance",
"DeploymentType": "SINGLE_INSTANCE",
"LogLevel": "INFO",
"DbInstanceType": "db.influx.small"
}
print(f"Example TypeDef: {instance_config}")
# You would typically call a client method here, e.g.:
# response = client.create_influx_db_instance(**instance_config)
# print(response)
# Example of a simpler client method call (adjust to actual API)
status_response = client.can_do_service_actions() # Placeholder for a simple client method
print(f"Service status check (placeholder): {status_response}")
except Exception as e:
print(f"An error occurred: {e}")
print("Note: This quickstart primarily demonstrates type hinting setup. Actual API calls require proper AWS credentials and service specific parameters.")