{"id":3156,"library":"mypy-boto3-timestream-write","title":"Mypy Boto3 Timestream Write Stubs","description":"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.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stubs","timestream"],"install":[{"cmd":"pip install mypy-boto3-timestream-write boto3","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Provides the underlying AWS SDK for Python; this library provides type stubs for it. Must be installed separately.","package":"boto3","optional":false},{"reason":"May be required for older Python versions (e.g., <3.10) for certain advanced type features.","package":"typing-extensions","optional":true}],"imports":[{"symbol":"TimestreamWriteClient","correct":"from mypy_boto3_timestream_write.client import TimestreamWriteClient"},{"note":"Example TypedDict for request parameters.","symbol":"WriteRecordsRequestRequestTypeDef","correct":"from mypy_boto3_timestream_write.type_defs import WriteRecordsRequestRequestTypeDef"},{"note":"Example TypedDict for response output.","symbol":"RecordsOutputTypeDef","correct":"from mypy_boto3_timestream_write.type_defs import RecordsOutputTypeDef"}],"quickstart":{"code":"import boto3\nimport os\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_timestream_write.client import TimestreamWriteClient\n    from mypy_boto3_timestream_write.type_defs import DescribeEndpointsResponseTypeDef\n\n# It's recommended to install boto3 in addition to mypy-boto3-timestream-write\n# pip install boto3 mypy-boto3-timestream-write\n\n# Initialize a boto3 client with explicit type annotation\n# This helps IDEs and type checkers provide accurate suggestions\nclient: TimestreamWriteClient = boto3.client(\n    \"timestream-write\",\n    region_name=os.environ.get('AWS_REGION', 'us-east-1'),\n    aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY'),\n    aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'YOUR_SECRET_KEY')\n)\n\ntry:\n    # Use a simple method to demonstrate type checking\n    response: DescribeEndpointsResponseTypeDef = client.describe_endpoints()\n    print(\"Timestream Write Endpoints:\")\n    for endpoint in response.get('Endpoints', []):\n        print(f\"  Address: {endpoint.get('Address')}, CachePeriodInMinutes: {endpoint.get('CachePeriodInMinutes')}\")\nexcept Exception as e:\n    print(f\"Error describing endpoints: {e}\")\n\n# Example of using a TypedDict\n# from mypy_boto3_timestream_write.type_defs import WriteRecordsRequestRequestTypeDef\n# write_request: WriteRecordsRequestRequestTypeDef = {\n#     \"DatabaseName\": \"my_database\",\n#     \"TableName\": \"my_table\",\n#     \"Records\": [\n#         {\n#             \"MeasureName\": \"cpu_utilization\",\n#             \"MeasureValue\": \"10.5\",\n#             \"MeasureValueType\": \"DOUBLE\",\n#             \"Time\": \"1678886400000\",\n#             \"TimeUnit\": \"MILLISECONDS\"\n#         }\n#     ]\n# }\n# print(f\"\\nSample WriteRecordsRequestRequestTypeDef: {write_request}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher.","message":"Python 3.8 support has been removed for all `mypy-boto3` packages with `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 should update to Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Ensure your environment and type checker (e.g., `mypy`, `pyright`) are up-to-date and configured to find PEP 561 stub packages in your `site-packages`.","message":"All `mypy-boto3` packages, including `mypy-boto3-timestream-write`, migrated to PEP 561-compliant packaging with `mypy-boto3-builder` version 8.12.0. This changes how type checkers locate stubs. While usually seamless with `pip`, ensure your build tools and environments correctly discover PEP 561 packages.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0"},{"fix":"Review and update `TypeDef` import paths and names in your codebase according to the latest documentation or the generated stub files.","message":"Some `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and conflicting `Extra` postfixes moved with `mypy-boto3-builder` version 8.9.0. If you explicitly import `TypeDef`s, these changes may break your code.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0"},{"fix":"Always ensure you have `boto3` installed (`pip install boto3`) in addition to `mypy-boto3-timestream-write`.","message":"This package provides *only* type annotations for `boto3` and `botocore`. It does not include `boto3` itself, which must be installed separately for your code to run at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Add explicit type annotations for `boto3` clients and resources (e.g., `client: TimestreamWriteClient = boto3.client(\"timestream-write\")`).","message":"For optimal type checking and IDE autocompletion, especially in VSCode and PyCharm, it is highly recommended to explicitly annotate the type of `boto3.client()` calls (e.g., `client: TimestreamWriteClient = boto3.client(...)`). While some IDEs offer implicit type discovery, explicit annotations provide the most consistent experience.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider `pip install boto3-stubs-lite[timestream-write]` (if available) or configure PyCharm to use external type checkers like `mypy` or `pyright`.","message":"PyCharm users might experience slow performance or high CPU usage due to how it handles `Literal` overloads in `mypy-boto3` packages. Using `boto3-stubs-lite` (if available for the service) or disabling PyCharm's internal type checker in favor of `mypy` or `pyright` is often recommended as a workaround.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}