Generate examples of serialized data from Pydantic models
Project description
pydantic-examples
Project to create examples of serialized Pydantic models with comments.
Intended to easily generate example config files if you load and validate the configuration using Pydantic.
From a model like:
from pydantic import BaseModel, Field
from pydantic_examples.yaml import yaml_with_comments
from typing import Annotated
class Example(BaseModel):
"""Example model"""
value: Annotated[str, Field(description="Does not really matter")] = "foo"
You can generate
# Example model
value: foo # Does not really matter
Status
This project was created with a single use-case in mind (yaml from Pydantic) but is open to PRs and collaboration on Github.
Feel free to file issues, raise PRs and join in if you want.
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
pydantic_examples-0.1.0.tar.gz
(23.6 kB
view details)
Built Distribution
File details
Details for the file pydantic_examples-0.1.0.tar.gz
.
File metadata
- Download URL: pydantic_examples-0.1.0.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2a52a11414c6e21f77b5b18a71a04054380c33970909aba95ea0a0216b41a30 |
|
MD5 | 7f0dd545b5b6176b36ae0b67aa1fa83c |
|
BLAKE2b-256 | 26643d4233d956aa4edcbd4812040bdbf4bdb4a7e2f1d07ec0f6ea825e371da1 |
File details
Details for the file pydantic_examples-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pydantic_examples-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5065edf848f5a392293686bc1261d1c10aedeeb37813c73827f10226de04fadb |
|
MD5 | 4cd220d158b4a22cc25ed99b41b60d27 |
|
BLAKE2b-256 | 82db861057ec6824ab187e89e55a4991a0f97703b6ab5a50cdd2d4dfc6554019 |