Skip to content

Feature request: Add Pydantic Models For boto3 #6705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
CoreOxide opened this issue May 22, 2025 · 1 comment
Open
2 tasks done

Feature request: Add Pydantic Models For boto3 #6705

CoreOxide opened this issue May 22, 2025 · 1 comment
Labels
feature-request feature request triage Pending triage from maintainers

Comments

@CoreOxide
Copy link

Use case

Allow using boto3 payloads \ responses as Python classes - more specifically - Pydantic classes.
This would eliminate the guesswork in filling field values, or constantly having to model response payloads.

Solution/User Experience

Lets take a look at a practical example:

import boto3

from aws_resource_validator.pydantic_models.dynamodb.dynamodb_classes import ListTablesOutput

dynamodb = boto3.client('dynamodb')

def list_dynamo_tables() -> List[str]:
    tables: ListTablesOutput = ListTablesOutput(**dynamodb.list_tables())
    return tables.TableNames


if __name__ == "__main__":
    tables: List[str] = list_dynamo_tables()
    print("DynamoDB Tables:", tables)

As you can see, the tables variable acts as a Python class, and you can access it's properties with .. All of it's fields already have types.

This is opposed to accessing the fields as dict keys, and receiving a value of unknown type.
As Powertools is all about ease of use and user experience, so I feel like it would be a great new home for AWS Resource Validator.

Alternative solutions

Instructing user to consume the library independently.

Acknowledgment

@CoreOxide CoreOxide added triage Pending triage from maintainers feature-request feature request labels May 22, 2025
Copy link

boring-cyborg bot commented May 22, 2025

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request feature request triage Pending triage from maintainers
Projects
Development

No branches or pull requests

1 participant