dataclass or pydantic for config objects that come from TOML
I'm parsing a config.toml into an object and torn between a plain dataclass and a pydantic BaseModel. The config has nested sections and I want actual validation — port should be an int, log level should be one of a few strings. I'm on pydantic 2.6. Is pydantic overkill for something this small? The file is maybe 30 keys total and this is a CLI tool, not a service.
4 replies