Skip to content

Document how to convert objects between proto and pydantic and reverse #50

@jankatins

Description

@jankatins

Is your feature request related to a problem? Please describe.

I tried to find if there is an easy way to convert objects form one format into another. The easiest I found is using dicts as a intermediate format.

Describe the solution you'd like

  • Something documented in the readme showcasing the conversion in both directions
  • Maybe: a nice <PydanticType>.from_proto(msg: <ProtoType>) -> <PydanticType> class method and <PydanticType>.to_proto() -> <ProtoType> method.

Describe alternatives you've considered

The dict method: convert proto/pydantic to dict, use that dict with two stars as input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions