MCPcopy Create free account
hub / github.com/ScrapeGraphAI/toonify / example_nested_models

Function example_nested_models

examples/pydantic_usage.py:101–122  ·  view source on GitHub ↗

Example: Nested Pydantic models.

()

Source from the content-addressed store, hash-verified

99
100
101def example_nested_models():
102 """Example: Nested Pydantic models."""
103 print("=== Nested Pydantic Models ===")
104
105 user = User(
106 id=2,
107 name='Bob Johnson',
108 email='bob@example.com',
109 age=35,
110 active=True,
111 address=Address(
112 street='123 Main Street',
113 city='Boston',
114 state='MA',
115 zipcode='02101'
116 )
117 )
118
119 toon = encode_pydantic(user)
120 print("TOON format:")
121 print(toon)
122 print()
123
124
125def example_exclude_options():

Callers 1

pydantic_usage.pyFile · 0.85

Calls 3

encode_pydanticFunction · 0.90
UserClass · 0.70
AddressClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…