Hacker News new | ask | show | jobs
by prionassembly 1702 days ago
Pydantic's BaseSettings has cured my configuration-DSL itch. You can type in (typed) defaults in Python and have them overidden by env vars.
1 comments

And Docker secrets! It's also pretty easy to rig them up with YAML files! BaseSettings is amazing.

The only gripe I have with Pydantic is that sometimes it has really opinionated type coercion that can get you in trouble sometimes. For instance, `Union[int, float]` will accept either an int or a float, sure, but it will always output an int. This isn't difficult to fix but may only realize it after having shot yourself in the foot.