Pydantic Cheatsheet 09 — pydantic-settings
Cheatsheet: BaseSettings, env_file, env_prefix, nested, secrets_dir, CLI integration.
Cheatsheet: BaseSettings, env_file, env_prefix, nested, secrets_dir, CLI integration.
Pydantic-settings: typed env config, .env, secrets directory, sources, CLI integration.
Cheatsheet: model_json_schema modes, json_schema_extra, custom JSON Schema, LLM tools.
Pydantic v2 perf tips, hot path optimization, FastAPI patterns, and when to consider msgspec / attrs.
Cheatsheet: speed pitfalls and fixes; when to reach for msgspec.
Cheatsheet: ValidationError.errors(), loc / type / msg, custom error envelopes, FastAPI 400/422.
Cheatsheet: from_attributes=True, computed fields from ORM, eager-loading relations, exclude sensitive.
Cheatsheet: Read/Create/Update model trio, PATCH partial updates, Pagination class, filter from class.
Cheatsheet: self-referencing, model_rebuild, mutually recursive, tree / graph patterns.
Cheatsheet: @computed_field, alias, exclude, type annotation, caching.