Skip to content
masterclass Buddy

Pydantic · Class

ImportString

ImportString lets a Pydantic field load a Python object from an import path. It accepts paths using dot or colon syntax and can also accept the object directly.

Last updated

Syntax

class Model(BaseModel):
    value: ImportString

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BaseModel
  • Field
  • ValidationError

Source: Pydantic Types | Pydantic Docs. Checked 2026-11-03.