Registry / type-stubs / mypy-boto3-forecast

mypy-boto3-forecast

JSON →
library1.43.0pypypi✓ verified 22d ago

This library provides type annotations (stubs) for `boto3`'s ForecastService, enabling static type checking with tools like MyPy. Its versioning closely tracks the corresponding `boto3` versions, ensuring compatibility with specific AWS API releases. It is actively maintained with frequent updates reflecting changes in the AWS Forecast service API.

pip install mypy-boto3-forecast boto3 mypy
INSTALL
IMPORT
SIG · MYPY-BOTO3-FORECAS
M
mypy-boto3-forecast
type-stubspythonv1.43.0
Install
5.8s avg
Import
Disk
114MB
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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 116.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.8s · import 0.000s · 114MB
114MB installed
● package 114MB
Code
Verified usage

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

ForecastClient
from mypy_boto3_forecast.client import ForecastClient
Import the typed client for the Forecast service.
ForecastServiceResource
from mypy_boto3_forecast.service_resource import ForecastServiceResource
Import the typed resource for the Forecast service, if using resource API.
ListDatasetsResponseTypeDef
from mypy_boto3_forecast.type_defs import ListDatasetsResponseTypeDef
Import specific TypedDicts for request/response bodies.

This example demonstrates how to initialize a typed `boto3` Forecast client and make a simple API call. The `mypy-boto3-forecast` library adds static type hints, allowing tools like MyPy to catch potential issues before runtime. Remember to configure your AWS credentials for the code to run successfully.

import boto3 from mypy_boto3_forecast.client import ForecastClient from mypy_boto3_forecast.type_defs import ListDatasetsResponseTypeDef import os # Ensure boto3 is configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars) # or ~/.aws/credentials and ~/.aws/config # Create a typed boto3 client for Forecast # The actual client is created by boto3.client, mypy-boto3 provides the type hint. client: ForecastClient = boto3.client( "forecast", region_name=os.environ.get('AWS_REGION_NAME', 'us-east-1') ) try: # Example API call with type-hinted response response: ListDatasetsResponseTypeDef = client.list_datasets(MaxResults=10) print("Successfully listed Forecast datasets:") for dataset in response.get('Datasets', []): print(f"- {dataset.get('DatasetName', 'N/A')} (ARN: {dataset.get('DatasetArn', 'N/A')})") except Exception as e: print(f"Error listing datasets (check AWS credentials and permissions): {e}") # In a real application, you might want to log the full exception details # To type-check this code, save it as e.g. `forecast_app.py` and run: # pip install mypy boto3 mypy-boto3-forecast # mypy forecast_app.py
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-forecast` 1.42.3 and newer), Python 3.8 support has been removed. All generated stub packages now require Python 3.9 or higher.
fix
Upgrade your Python environment to 3.9 or newer. If you must use Python 3.8, use an older `mypy-boto3-forecast` version, but be aware it won't have the latest AWS API types.
affects: mypy-boto3-forecast >= 1.42.3
gotchaThe version of `mypy-boto3-forecast` must ideally match the major and minor version of your installed `boto3` library to ensure accurate type checking. Mismatched versions can lead to incorrect type hints for new or deprecated API features.
fix
Keep your `mypy-boto3-forecast` and `boto3` versions synchronized. For example, if you use `boto3==1.x.y`, install `mypy-boto3-forecast==1.x.z`.
affects: All versions
breakingBuilder version 8.9.0 (affecting stub packages generated after this builder version) introduced breaking changes in how some TypeDef names are generated, favoring shorter names or resolving conflicts. Code explicitly referencing old, longer TypeDef names might break.
fix
Review the API changes in the `mypy-boto3` documentation or `boto3` documentation for the specific service and adjust TypeDef names in your code if you encounter `NameError` or type resolution issues during static analysis.
affects: mypy-boto3-forecast generated by builder >= 8.9.0
gotchaInstalling `mypy-boto3` (which includes stubs for all AWS services) alongside `mypy-boto3-forecast` (stubs for a single service) is redundant for the Forecast service. While usually harmless, it can increase installation size.
fix
Install either `mypy-boto3` for all service stubs or `mypy-boto3-forecast` for only the Forecast service stubs, not both for the same service.
affects: All versions
gotchaThese are type stubs and provide no runtime functionality. To benefit from `mypy-boto3-forecast`, you must explicitly run `mypy` (or another compatible type checker) on your codebase. The stubs do not alter `boto3`'s runtime behavior.
fix
Integrate `mypy` into your development workflow (e.g., CI/CD, pre-commit hooks) to continuously type-check your code.
affects: All versions
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources