Skip to content

Support for Code Generation for Pydantic v2 #3

@almogtavor

Description

@almogtavor

I would like to suggest the addition of support for code generation for Pydantic v2 types in the pkl-python library. In case others think that there's a reason to keep generating classes without Pydantic, I suggest letting the user to choose its target classes generation type (with Pydantic/ without). Pydantic v2 brings features that can enhance the usability and functionality of the pkl-python library.

Why Pydantic is Needed Even when using pkl:

  1. Standardized Data Models:

    • Pydantic v2 models are widely used in modern Python applications, particularly in APIs and data processing pipelines. By supporting Pydantic v2, pkl-python can facilitate the integration and interoperability with other systems that rely on these standardized models.
  2. Compatibility with Existing Ecosystem (especially with FastAPI):

    • Many tools and libraries in the Python ecosystem are updating to support Pydantic v2. FastAPI, a popular web framework, heavily utilizes Pydantic models. Adding support for Pydantic v2 in pkl-python would streamline the process of using pkl-python with FastAPI applications, making it easier to generate and manipulate models within the same ecosystem.
    • For example integration with FastAPI ORMs
  3. Backward Compatibility:

Anyway, thank you for considering this. I look forward to seeing pkl-python evolve with the support for Pydantic v2 types.

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