Skip to main content

Strongly-typed, SDK-like wrapper around boto3 powered by Pydantic models from aws-resource-validator.

Project description

typed_boto3

A strongly-typed, SDK-like wrapper around boto3. Inputs and outputs on every client method are concrete Pydantic models — no dicts, no magic strings.

Install

poetry install

typed_boto3 depends on aws-resource-validator for the generated Pydantic models that describe every AWS request/response shape.

Usage

import typed_boto3
from typed_boto3 import ServiceName, Region, ClientConfig
from aws_resource_validator.pydantic_models.lambda_.lambda__classes import (
    CreateFunctionRequestTypeDef,
    FunctionCodeTypeDef,
)

config = ClientConfig(region=Region.US_EAST_1)
client = typed_boto3.client(ServiceName.LAMBDA, config)  # typed as LambdaClient

resp = client.create_function(
    CreateFunctionRequestTypeDef(
        FunctionName="my-fn",
        Runtime="python3.11",
        Role="arn:aws:iam::123456789012:role/my-role",
        Handler="app.handler",
        Code=FunctionCodeTypeDef(ZipFile=b"..."),
    )
)
# resp is a FunctionConfigurationResponseTypeDef
print(resp.FunctionArn)

The direct form is also supported:

from typed_boto3 import LambdaClient
client = LambdaClient(ClientConfig(region=Region.US_EAST_1))

Regenerating

poetry run python -m typed_boto3.generator --regions
poetry run python -m typed_boto3.generator --service lambda s3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typed_boto3_sdk-0.1.0.tar.gz (123.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typed_boto3_sdk-0.1.0-py3-none-any.whl (139.2 kB view details)

Uploaded Python 3

File details

Details for the file typed_boto3_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: typed_boto3_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 123.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for typed_boto3_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 77cb05d52b917081764d78a7bbd3dc6210c963c96da3b0360cc84d6e2151d18a
MD5 f694abcf3fb539f5ab16072e10b2bd8e
BLAKE2b-256 231d37259b831ba8354060a062a435e2950644924f06a8f1ceedfe3387b190e8

See more details on using hashes here.

File details

Details for the file typed_boto3_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: typed_boto3_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 139.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for typed_boto3_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3aa556e9ac994bd78b80b43a08d5bef655721c4104d2b4e21706b6005a8e2e8a
MD5 6eed352cc0778011140b3ccdb277c8e5
BLAKE2b-256 d627dfa3bf5ace3a8a18ba8d2bbc57a7a8904435efddbe194ad282602d41a9fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page