Skip to main content

Pydantic interface codegen from Amazon Smithy JSON schemas

Project description

botodto

Pydantic model codegen from AWS OpenAPI schemas generated from the AWS JS/TS SDK (v3)

Mission statement

The goal of this library is to wrap boto3 clients so that all calls to AWS APIs through them are ingested into, and emit responses as Pydantic models.

Implementation

OpenAPI schemas are produced from the AWS Javascript SDK (v2) in the OpenAPI Directory by the aws2openapi tool.

These can be used to produce reliable Pydantic data models using datamodel-code-generator (to clarify: with minimal? no? manual editing of the result).

My implementation will take one of the following routes [TBD]:

  • replaces the aws2openapi tool with a Python converter for the v3 SDK (simplest approach, more work?)

    • Theoretically this is the nicest approach
    • It isn't a good idea to approach this without a proof of concept that the proposed solution is viable
  • amends the OpenAPI schema generated by aws2openapi from the v2 SDK to include exceptions from the v3 SDK

    • This could be a neat solution
  • amends the Pydantic models to include exceptions from the v3 SDK (potentially awkward manual mapping exercise, but least work?)

    • This could be a simple proof of concept

I propose to start with the latter approach, for a single service, end to end, and stub out the other services. After this is shown to work, automate the process for the other services.

Reliability

  • I will use a test suite to check the results work for all schemas (there are a lot!)

  • I would like to avoid manual data transfer or generation where possible to make this repeatable, and not deteriorate after writing.

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

botodto-0.0.2.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

botodto-0.0.2-py3-none-any.whl (65.3 kB view details)

Uploaded Python 3

File details

Details for the file botodto-0.0.2.tar.gz.

File metadata

  • Download URL: botodto-0.0.2.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for botodto-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5763bedcd2ac350ef022572de19bc388f0db1c617984bc63a97fff782f34c1a7
MD5 55d507b462f40b54c94ad9ccdf091906
BLAKE2b-256 8c4e6bdaa3563981e468a08acd860344a70eee347a204cb4905fa68d34aaf248

See more details on using hashes here.

File details

Details for the file botodto-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: botodto-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 65.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for botodto-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 41db2a44d686f3cf075e9dbacd8e64c6cc6b08c4131704cb36bc4dd94be7bf77
MD5 7010dba5d8a23ff9a9e15dfc84506496
BLAKE2b-256 09105a5c854635583677a65397552fef0c601aa772000fb667593a0ce917b527

See more details on using hashes here.

Supported by

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