Skip to content
masterclass Buddy

Pydantic · Type Alias

DirectoryPath

DirectoryPath is a Pydantic type for paths that must point to existing directories. It rejects files and paths that do not exist.

Last updated

Syntax

class Model(BaseModel):
    folder: DirectoryPath

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

Subscribe
  • Path
  • FilePath
  • NewPath
  • SocketPath
  • BaseModel
  • ValidationError

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