Registry /
type-stubs / mypy-boto3-timestream-write
mypy-boto3-timestream-write provides type annotations for the `boto3` TimestreamWrite service (version 1.42.3), enabling static analysis, improved IDE autocompletion, and robust type checking for your AWS interactions. This package is generated by `mypy-boto3-builder` (version 8.12.0) and is updated frequently to stay in sync with `boto3` and `botocore` releases.
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
muslpy 3.10–3.925 runs
installs and imports cleanly · install 0.0s · import 0.607s · 51.3MB
glibcpy 3.10–3.925 runs
installs and imports cleanly · install 3.8s · import 0.573s · 52MB
50MB installed
● package 50MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from mypy_boto3_timestream_write.client import TimestreamWriteClient
Example TypedDict for request parameters.
from mypy_boto3_timestream_write.type_defs import WriteRecordsRequestRequestTypeDef
Example TypedDict for response output.
from mypy_boto3_timestream_write.type_defs import RecordsOutputTypeDef
This quickstart demonstrates how to initialize a `boto3` client with `mypy-boto3-timestream-write` type annotations and make a basic API call like `describe_endpoints`. It also shows how to import and use generated `TypedDict` definitions. Remember to install `boto3` alongside the stub package.
import boto3
import os
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_timestream_write.client import TimestreamWriteClient
from mypy_boto3_timestream_write.type_defs import DescribeEndpointsResponseTypeDef
# It's recommended to install boto3 in addition to mypy-boto3-timestream-write
# pip install boto3 mypy-boto3-timestream-write
# Initialize a boto3 client with explicit type annotation
# This helps IDEs and type checkers provide accurate suggestions
client: TimestreamWriteClient = boto3.client(
"timestream-write",
region_name=os.environ.get('AWS_REGION', 'us-east-1'),
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY'),
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'YOUR_SECRET_KEY')
)
try:
# Use a simple method to demonstrate type checking
response: DescribeEndpointsResponseTypeDef = client.describe_endpoints()
print("Timestream Write Endpoints:")
for endpoint in response.get('Endpoints', []):
print(f" Address: {endpoint.get('Address')}, CachePeriodInMinutes: {endpoint.get('CachePeriodInMinutes')}")
except Exception as e:
print(f"Error describing endpoints: {e}")
# Example of using a TypedDict
# from mypy_boto3_timestream_write.type_defs import WriteRecordsRequestRequestTypeDef
# write_request: WriteRecordsRequestRequestTypeDef = {
# "DatabaseName": "my_database",
# "TableName": "my_table",
# "Records": [
# {
# "MeasureName": "cpu_utilization",
# "MeasureValue": "10.5",
# "MeasureValueType": "DOUBLE",
# "Time": "1678886400000",
# "TimeUnit": "MILLISECONDS"
# }
# ]
# }
# print(f"\nSample WriteRecordsRequestRequestTypeDef: {write_request}")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.