mypy-boto3-billingconductor Type Annotations
mypy-boto3-billingconductor provides drop-in type annotations for the `boto3` BillingConductor service. It enhances development with static type checking for `boto3` clients, resources, paginators, and waiters. Maintained by `mypy-boto3-builder`, it is frequently updated to align with `boto3` releases and ensures compatibility with popular IDEs and type checkers like mypy and pyright.
Warnings
- breaking Python 3.8 support has been removed for packages generated by `mypy-boto3-builder` version 8.12.0 and newer. This specific `mypy-boto3-billingconductor` version (1.42.7) was generated with `builder 8.12.0`.
- breaking Packages generated by `mypy-boto3-builder` (version 8.12.0 onwards) have migrated to PEP 561-compliant distribution. While generally seamless, if you have custom build processes or tools that rely on specific stub discovery mechanisms, you might need to verify compatibility.
- deprecated The original `mypy-boto3` package is now considered 'legacy'. Users are encouraged to install service-specific packages (like `mypy-boto3-billingconductor`) or the umbrella `types-boto3` or `boto3-stubs` packages for type annotations.
- gotcha This library only provides type annotations. The actual `boto3` runtime library must be installed separately for your code to execute. Without `boto3` installed, your code will fail at runtime.
- gotcha For optimal IDE code completion and faster type checking, especially in older IDEs or specific `mypy` configurations, explicit type annotations (e.g., `client: BillingConductorClient = session.client('billingconductor')`) are recommended rather than relying solely on inference.
- gotcha When using `if TYPE_CHECKING:` for conditional imports to avoid runtime dependencies, `pylint` may incorrectly report 'undefined variable' errors. This is a known issue with `pylint`.
Install
-
pip install mypy-boto3-billingconductor boto3
Imports
- BillingConductorClient
from mypy_boto3_billingconductor.client import BillingConductorClient
- BillingConductorServiceResource
from mypy_boto3_billingconductor.service_resource import BillingConductorServiceResource
- CreatePricingRuleResponseTypeDef
from mypy_boto3_billingconductor.type_defs import CreatePricingRuleResponseTypeDef
Quickstart
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_billingconductor.client import BillingConductorClient
session = boto3.Session()
client: BillingConductorClient = session.client("billingconductor")
try:
# Example: List Pricing Plans (assuming you have some)
response = client.list_pricing_plans(
MaxResults=5
)
print(f"Pricing Plans: {response.get('PricingPlans')}")
print("Quickstart executed successfully, type hints are active.")
except Exception as e:
print(f"An error occurred: {e}")
print("This is expected if AWS credentials are not configured or no pricing plans exist.")