mypy-boto3-groundstation
mypy-boto3-groundstation provides type annotations for the `boto3` GroundStation service, generated by `mypy-boto3-builder`. It enhances developer experience by enabling static type checking for `boto3` client calls. The current version is 1.42.35, and it follows the release cadence of `mypy-boto3-builder`, which updates frequently with AWS service changes.
Warnings
- breaking `mypy-boto3-builder` (which generates this package) removed support for Python 3.8 starting from builder version 8.12.0. This means `mypy-boto3-groundstation` versions generated by builder 8.12.0 or newer will require Python 3.9+.
- gotcha This package provides *type stubs* for `boto3` and does not include the `boto3` runtime itself. `boto3` must be installed separately for your code to run.
- breaking The `mypy-boto3-builder` migrated to PEP 561 compliant packages in version 8.12.0. While this is generally beneficial, it might affect how some build systems or custom tooling discover and consume these type packages.
- gotcha TypeDef naming conventions can change with `mypy-boto3-builder` updates. For instance, in builder 8.9.0, verbose names like `CreateDistributionRequestRequestTypeDef` were shortened to `CreateDistributionRequestTypeDef`.
Install
-
pip install boto3 mypy-boto3-groundstation
Imports
- GroundStationClient
from mypy_boto3_groundstation.client import GroundStationClient
- GroundStationServiceResource
from mypy_boto3_groundstation.service_resource import GroundStationServiceResource
- ConfigTypeTypeDef
from mypy_boto3_groundstation.type_defs import ConfigTypeTypeDef
Quickstart
import boto3
from mypy_boto3_groundstation.client import GroundStationClient
from mypy_boto3_groundstation.type_defs import ListConfigsResponseTypeDef
def get_groundstation_config_types() -> List[str]:
# The 'client' variable is now type-hinted by mypy-boto3-groundstation
client: GroundStationClient = boto3.client("groundstation")
# Methods and their return types are type-checked
response: ListConfigsResponseTypeDef = client.list_configs()
config_types = [config['configType'] for config in response.get('configList', [])]
return config_types
if __name__ == "__main__":
# Example of running the function (requires AWS credentials configured for boto3)
try:
print(f"Available GroundStation config types: {get_groundstation_config_types()}")
except Exception as e:
print(f"Error fetching config types (ensure AWS config): {e}")