File: pydantic.py

package info (click to toggle)
pytkdocs 0.16.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 784 kB
  • sloc: python: 4,621; makefile: 28; javascript: 13
file content (11 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
from typing import Set

from pydantic import BaseModel, Field


class Person(BaseModel):
    """Simple Pydantic Model for a person's information"""

    name: str = Field("PersonA", description="The person's name")
    age: int = Field(18, description="The person's age which must be at minimum 18")
    labels: Set[str] = Field(set(), description="Set of labels the person can be referred by")