Skip to content
masterclass Buddy

Pydantic · Type Alias

FilePath

FilePath validates that a value points to an existing file. A valid value becomes a pathlib.Path object; directories and missing paths fail validation.

Last updated

Syntax

class Model(BaseModel):
    file: FilePath

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

Subscribe
  • DirectoryPath
  • NewPath
  • SocketPath
  • PathType

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