Registry / type-stubs / mypy-boto3-compute-optimizer

mypy-boto3-compute-optimizer

JSON →
library1.43.33pypypi✓ verified 24d ago

mypy-boto3-compute-optimizer provides type annotations for the boto3 AWS SDK, specifically for the Compute Optimizer service. It ensures static type checking for your boto3 calls related to Compute Optimizer, improving code reliability and developer experience. The current version is 1.42.3, and it's part of the frequently updated mypy-boto3-builder ecosystem, with new versions often released alongside boto3 updates or builder improvements.

pip install mypy-boto3-compute-optimizer boto3
INSTALL
IMPORT
SIG · MYPY-BOTO3-COMPUTE
M
mypy-boto3-compute-optimizer
type-stubspythonv1.43.33
Install
4.1s avg
Import
617ms
Disk
50MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.43.33 · 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.636s · 52.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.1s · import 0.598s · 53MB
50MB installed
● package 50MB
Code
Verified usage

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

ComputeOptimizerClient
from mypy_boto3_compute_optimizer import ComputeOptimizerClient
Import the typed client for Compute Optimizer to annotate boto3.client('compute-optimizer').
DescribeRecommendationSummariesResponseTypeDef
from mypy_boto3_compute_optimizer.type_defs import DescribeRecommendationSummariesResponseTypeDef
Import specific TypeDefs for precise response or request body annotations.
Client
import boto3 from mypy_boto3_compute_optimizer import Client as ComputeOptimizerClientType
from mypy_boto3_compute_optimizer.client import ComputeOptimizerClient
While importing Client directly from the 'client' submodule works, the top-level import is generally preferred and more robust against internal structure changes.

This quickstart demonstrates how to initialize a `boto3` client for Compute Optimizer and use the provided type hints for both the client itself and its method responses. This enables static analysis tools like Mypy to catch potential errors at development time.

import boto3 from mypy_boto3_compute_optimizer import ComputeOptimizerClient from mypy_boto3_compute_optimizer.type_defs import ListRecommendationSummariesResponseTypeDef # Ensure boto3 is installed: pip install boto3 mypy-boto3-compute-optimizer def get_compute_optimizer_summary(): # The type hint 'ComputeOptimizerClient' provides static analysis for client methods. client: ComputeOptimizerClient = boto3.client("compute-optimizer") # The type hint 'ListRecommendationSummariesResponseTypeDef' helps with response structure. response: ListRecommendationSummariesResponseTypeDef = client.list_recommendation_summaries() print("Account Recommendation Summaries:") for summary in response.get("RecommendationSummaries", []): print(f" Account ID: {summary.get('AccountId')}, ") print(f" Recommendation Count: {summary.get('RecommendationCount')}") if __name__ == "__main__": get_compute_optimizer_summary()
Debug
Known issues
breakingSupport for Python 3.8 has been removed in mypy-boto3-builder version 8.12.0 and subsequent stub packages. Your project must use Python 3.9 or newer.
fix
Upgrade your Python environment to 3.9 or higher. For projects requiring older Python versions, use an older version of mypy-boto3-compute-optimizer (e.g., <1.42.0) if available, but this is not recommended due to lack of updates.
affects: mypy-boto3-builder >= 8.12.0, mypy-boto3-compute-optimizer >= 1.42.0
breakingTypeDef naming conventions changed in mypy-boto3-builder 8.9.0. This might affect explicit imports of TypeDefs (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).
fix
If you directly import `TypeDef` classes and encounter `ModuleNotFoundError` or `AttributeError`, check the `mypy-boto3` documentation or generated stubs for the updated naming pattern, which typically involves shorter names or `Extra` postfix moved to the end.
affects: mypy-boto3-builder >= 8.9.0, mypy-boto3-compute-optimizer >= 1.35.0 (approx.)
gotchaThis package provides type stubs only. You must also install the `boto3` library for your code to run at runtime. Without `boto3`, your application will fail with import errors.
fix
Always install `boto3` alongside `mypy-boto3-compute-optimizer` (e.g., `pip install boto3 mypy-boto3-compute-optimizer`).
affects: All versions
gotchaThis is a service-specific stub package for AWS Compute Optimizer. If you need type annotations for other AWS services (e.g., S3, EC2), you must install their respective `mypy-boto3-<service-name>` packages.
fix
Install the specific `mypy-boto3-<service-name>` package for each AWS service you are using in your project.
affects: All versions
Upgrade
Version history
1.43.33latest on PyPI · released Jun 18, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3. The actual boto3 library is required for runtime functionality.
Agent activity
18 hits · last 30 days
node
14
OpenAI (training)
1
Resources
mypy-boto3-compute-optimizer — pip install mypy-boto3-compute-optimizer · libregistry