Registry / type-stubs / mypy-boto3-meteringmarketplace

mypy-boto3-meteringmarketplace

JSON →
library1.43.80pypypi✓ verified 23d ago

mypy-boto3-meteringmarketplace provides comprehensive type annotations for the `boto3` MarketplaceMetering service (version 1.42.58). Generated by `mypy-boto3-builder`, these stubs enhance development with static type checking, auto-completion, and error detection in IDEs and tools like mypy and pyright. The library frequently updates to stay in sync with `boto3` and `botocore` releases, ensuring up-to-date type definitions for AWS SDK interactions.

pip install mypy-boto3-meteringmarketplace
INSTALL
IMPORT
SIG · MYPY-BOTO3-METERIN
M
mypy-boto3-meteringmarketplace
type-stubspythonv1.43.80
Install
2.8s avg
Import
561ms
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.80 · 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.910 runs
installs and imports cleanly · install 0.0s · import 0.570s · 51.8MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.8s · import 0.552s · 52MB
50MB installed
● package 50MB
Code
Verified usage

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

MarketplaceMeteringClient
from mypy_boto3_meteringmarketplace import MarketplaceMeteringClient
from mypy_boto3_meteringmarketplace import MarketplaceMeteringClient

This quickstart demonstrates how to initialize a typed `MarketplaceMeteringClient` and make a sample API call like `register_usage`. Type hints are applied for the client and the response, leveraging the installed `mypy-boto3-meteringmarketplace` stubs. Replace placeholder values with actual AWS credentials and valid Marketplace Metering data. The `TYPE_CHECKING` block ensures that stub imports are only active during type checking, avoiding runtime dependencies on stub packages.

import os import boto3 from typing import TYPE_CHECKING # Ensure you have boto3 installed for runtime and mypy-boto3-meteringmarketplace for type checking if TYPE_CHECKING: from mypy_boto3_meteringmarketplace.client import MarketplaceMeteringClient from mypy_boto3_meteringmarketplace.type_defs import RegisterUsageOutputTypeDef # Standard boto3 client creation (runtime) client: MarketplaceMeteringClient = boto3.client( "meteringmarketplace", region_name=os.environ.get("AWS_REGION", "us-east-1"), aws_access_key_id=os.environ.get("AWS_ACCESS_KEY_ID", ""), aws_secret_access_key=os.environ.get("AWS_SECRET_ACCESS_KEY", ""), aws_session_token=os.environ.get("AWS_SESSION_TOKEN", ""), ) try: # Example: Registering usage. Note: ProductCode and UsageAllocations are required. # This is a dummy example; replace with actual logic and valid data. product_code = "YOUR_PRODUCT_CODE" usage_allocations = [ {"AllocatedUsageQuantity": 1, "Tags": [{"Key": "Dim", "Value": "Val"}]} ] response: RegisterUsageOutputTypeDef = client.register_usage( ProductCode=product_code, UsageAllocations=usage_allocations, UsageQuantity=1, # Deprecated, UsageAllocations is preferred Timestamp=int(os.time.time()), ) print(f"Usage registration successful: {response.get('UsageMeteringRecordId')}") except client.exceptions.ProductCodeNotFoundException: print(f"Error: Product code '{product_code}' not found.") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingPython 3.8 support was removed in `mypy-boto3-builder` version 8.12.0 and later. Ensure your project runs on Python 3.9 or higher. [cite: 8.12.0 release notes]
fix
Upgrade your Python environment to 3.9 or newer.
affects: >=8.12.0
breakingStarting with `mypy-boto3-builder` 8.9.0, some `TypeDef` names were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`) and conflicting `TypeDef` postfixes were reordered. [cite: 8.9.0 release notes]
fix
Review your explicit `TypedDict` imports and usages, and update names according to the latest generated stubs.
affects: >=8.9.0
gotchaThe `mypy-boto3-builder` project migrated to PEP 561 packages in version 8.12.0. This might affect how type checkers discover stubs in complex project setups or older environments. [cite: 8.12.0 release notes]
fix
Ensure your type checker (e.g., mypy, pyright) is up-to-date and configured to correctly resolve PEP 561 packages. Most modern setups should handle this automatically.
affects: >=8.12.0
gotchaIf you experience slow performance or high CPU usage with PyCharm, especially with `Literal` overloads, it is recommended to use the `boto3-stubs-lite` version instead. This offers a more RAM-friendly experience at the cost of requiring more explicit type annotations.
fix
Install the lite version: `pip install boto3-stubs-lite[meteringmarketplace]` or disable PyCharm's type checker and rely on external tools like mypy/pyright.
affects: All
gotchaFor Pylint compatibility, if it complains about undefined variables when using type hints, consider wrapping your stub imports with `if TYPE_CHECKING:` blocks and assigning `object` to the types outside the block.
fix
Implement the `if TYPE_CHECKING:` pattern as shown in the quickstart example, ensuring Pylint correctly parses the code during non-type-checking runs.
affects: All
gotchaAWS 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 a service client or type definition is not found, verify the current service name in `boto3` documentation. [cite: 8.11.0 release notes]
fix
Consult the official `boto3` documentation or `mypy-boto3-builder` releases for any service name changes and update your imports accordingly.
affects: All
Upgrade
Version history
1.43.80latest on PyPI · released Aug 25, 2026
Audit
Dependencies
boto3requiredRuntime dependency for the AWS SDK for Python, which these stubs provide type hints for.
Agent activity
17 hits · last 30 days
node
12
OpenAI (training)
2
Resources
mypy-boto3-meteringmarketplace — pip install mypy-boto3-meteringmarketplace · libregistry