{"id":3114,"library":"mypy-boto3-meteringmarketplace","title":"mypy-boto3-meteringmarketplace Type Annotations","description":"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.","status":"active","version":"1.42.58","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["python","types","mypy","boto3","aws","stub","type-hints","aws-marketplace-metering"],"install":[{"cmd":"pip install mypy-boto3-meteringmarketplace","lang":"bash","label":"Install service stubs"},{"cmd":"pip install boto3 mypy-boto3-meteringmarketplace","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python, which these stubs provide type hints for.","package":"boto3","optional":false}],"imports":[{"wrong":"from mypy_boto3_meteringmarketplace import MarketplaceMeteringClient","symbol":"MarketplaceMeteringClient","correct":"from mypy_boto3_meteringmarketplace import MarketplaceMeteringClient"}],"quickstart":{"code":"import os\nimport boto3\nfrom typing import TYPE_CHECKING\n\n# Ensure you have boto3 installed for runtime and mypy-boto3-meteringmarketplace for type checking\n\nif TYPE_CHECKING:\n    from mypy_boto3_meteringmarketplace.client import MarketplaceMeteringClient\n    from mypy_boto3_meteringmarketplace.type_defs import RegisterUsageOutputTypeDef\n\n# Standard boto3 client creation (runtime)\nclient: MarketplaceMeteringClient = boto3.client(\n    \"meteringmarketplace\",\n    region_name=os.environ.get(\"AWS_REGION\", \"us-east-1\"),\n    aws_access_key_id=os.environ.get(\"AWS_ACCESS_KEY_ID\", \"\"),\n    aws_secret_access_key=os.environ.get(\"AWS_SECRET_ACCESS_KEY\", \"\"),\n    aws_session_token=os.environ.get(\"AWS_SESSION_TOKEN\", \"\"),\n)\n\ntry:\n    # Example: Registering usage. Note: ProductCode and UsageAllocations are required.\n    # This is a dummy example; replace with actual logic and valid data.\n    product_code = \"YOUR_PRODUCT_CODE\"\n    usage_allocations = [\n        {\"AllocatedUsageQuantity\": 1, \"Tags\": [{\"Key\": \"Dim\", \"Value\": \"Val\"}]}\n    ]\n\n    response: RegisterUsageOutputTypeDef = client.register_usage(\n        ProductCode=product_code,\n        UsageAllocations=usage_allocations,\n        UsageQuantity=1, # Deprecated, UsageAllocations is preferred\n        Timestamp=int(os.time.time()),\n    )\n    print(f\"Usage registration successful: {response.get('UsageMeteringRecordId')}\")\n\nexcept client.exceptions.ProductCodeNotFoundException:\n    print(f\"Error: Product code '{product_code}' not found.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 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]","severity":"breaking","affected_versions":">=8.12.0"},{"fix":"Review your explicit `TypedDict` imports and usages, and update names according to the latest generated stubs.","message":"Starting 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]","severity":"breaking","affected_versions":">=8.9.0"},{"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.","message":"The `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]","severity":"gotcha","affected_versions":">=8.12.0"},{"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.","message":"If 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.","severity":"gotcha","affected_versions":"All"},{"fix":"Implement the `if TYPE_CHECKING:` pattern as shown in the quickstart example, ensuring Pylint correctly parses the code during non-type-checking runs.","message":"For 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.","severity":"gotcha","affected_versions":"All"},{"fix":"Consult the official `boto3` documentation or `mypy-boto3-builder` releases for any service name changes and update your imports accordingly.","message":"AWS 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]","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'1.42.58':21 'annot':6,14 'auto':37 'auto-complet':36 'aw':71,78,84 'aws-marketplace-met':83 'boto3':3,9,17,26,59,77 'botocor':61 'builder':27 'check':35 'complet':38 'comprehens':12 'date':67 'definit':69 'detect':41 'develop':31 'enhanc':30 'ensur':63 'error':40 'frequent':52 'generat':22 'hint':82 'ide':43 'interact':73 'librari':51 'like':46 'marketplac':85 'marketplacemet':18 'meter':86 'meteringmarketplac':4,10 'mypi':2,8,25,47,76 'mypy-boto3-builder':24 'mypy-boto3-meteringmarketplace':1,7 'provid':11 'pyright':49 'python':74 'releas':62 'sdk':72 'servic':19 'static':33 'stay':55 'stub':29,79 'sync':57 'tool':45 'type':5,13,34,68,75,81 'type-hint':80 'up-to-d':64 'updat':53 'version':20","created_at":"2026-04-11T09:21:39.329843+00:00","updated_at":"2026-04-16T17:04:53.603871+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmppduoatkh/venv/lib/python3.12/site-packages/mypy_boto3_meteringmarketplace/__init__.py\", line 22, in <module>\n    from .client import MarketplaceMeteringClient\n  File \"/tmp/tmppduoatkh/venv/lib/python3.12/site-p"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.80","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/mypy_boto3_meteringmarketplace/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-meteringmarketplace/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-08-28","next_check":"2026-07-10","install_tag":null}}