Skip to main content

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.2.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

pydantic_examples-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_examples-0.1.2.tar.gz.

File metadata

  • Download URL: pydantic_examples-0.1.2.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

Hashes for pydantic_examples-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c3cbb11ffda7a7235766ce2a37eebe62a79cf6d837b21d25bc40de7969287196
MD5 c4d716b53f79a58c11be77c9c439e667
BLAKE2b-256 bbc74803f4f682b9059d6110eea467b5ad4540ce482e6b23faf32fa12f696e19

See more details on using hashes here.

File details

Details for the file pydantic_examples-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_examples-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f867c2a164fabbeaae144d0c0c79b7b87d37d724602b3d96677d7a1847ca3c29
MD5 90e0004f33106fe82d7d354c1f6eadcd
BLAKE2b-256 f65335ec51c40bd8575ca5e0526d1e8668db47290592d5f4f34837e2ea28b312

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page