Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on piefed.ca
show_and_tell·Show & TellbyNotSteve_

I created my first (tiny) Python library! PyMicroConf: a tiny TOML config handler

I was working on another random side project and wanted to define configs like Pydantic-Settings without actually pulling in all of Pydantic into my project, so I started writing a custom config class which turned out generic enough that I could break it off into its own thing.

One of the main things I wanted is to be able to load a TOML file for settings but to also be able to override each config option with an env var. I also really like Pydantic's use of Annotation[..., ...] type-hinting so I did something similar

I don't really expect it to be used by anyone else but I'm excited about putting out my first PyPi package and figured I'd share it here :)

Any feedback is very welcome!

PyPi link: https://pypi.org/project/pymicroconf/

Also AI disclosure: I got AI to partially write the description but the code itself isn't written by AI

I created my first (tiny) Python library! PyMicroConf: a tiny TOML config handlerhttps://github.com/NickBrisebois/pymicroconfOpen linkView original on piefed.ca
14

3 replies

lemmy.world

Thanks for sharing! I've been using TOML for some simple user-friendly config settings. It's great to see more structured approaches to using it.

3

You reached the end

I created my first (tiny) Python library! PyMicroConf: a tiny TOML config handler | Spyke