Generate commented 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.3.tar.gz
(24.2 kB
view details)
Built Distribution
File details
Details for the file pydantic_examples-0.1.3.tar.gz
.
File metadata
- Download URL: pydantic_examples-0.1.3.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f86ccd6609e46ecc64321ee197cf1ea351ada6452a4704c94fefb3948158ce2 |
|
MD5 | 12e592fdaeab5ff235efa277a37eb2e8 |
|
BLAKE2b-256 | 8155df4cdc267bc74aad6b84bfe2fcc89c2aea9dd84d856b0e141799707720e9 |
File details
Details for the file pydantic_examples-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: pydantic_examples-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.6 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 | 42b3035ec96c641e21828559ee5dd08e1fd976ef25649dc037134625e15f3f4c |
|
MD5 | ff8210ac84f04eb4f2da7268b7d2e233 |
|
BLAKE2b-256 | 107ebe8d7a9fa4ecd1ec1855c564adff9b12875549c57c5a62f2ac6963729088 |