Your personal configuration doggo.
Project description
confdoggo 🐶
Define your builtin settings:
class MySettings(confdoggo.Settings):
class _(confdoggo.Settings):
host: str = "localhost"
port: int = 8080
server = _()
class _(confdoggo.Settings):
x: int = 42
client = _()
reload_on_changes = True
scheduled_shutdown: datetime = None
Let confdoggo catch the configuration files, and run extensible type checking:
settings = confdoggo.go_catch(
MySettings,
[
'file://./simple.json', # a local file
Path('.') / 'another_one.yaml', # another local file
'ftp://192.168.1.1/folder/file.json', # a remote file
'https://192.168.1.2/folder/file.ini', # another remote file
],
)
Note: order matters! Configurations that have a higher index have higher importance.
Access configuration easily:
assert settings.server.port == 8080
See a full example here.
Install
$ pip install confdoggo
Under development
This project is under development: expect breaking changes!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
confdoggo-0.1.0a1.tar.gz
(18.5 kB
view hashes)
Built Distribution
Close
Hashes for confdoggo-0.1.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a65a1d455413481cc96f13dccd04d0641e040d3e5f5b264137e559f3e4e2a5ae |
|
MD5 | cff6bae5c795b49e1ae5b4798daff582 |
|
BLAKE2b-256 | 6d58811d05c2c7003f18da38c98d46f8d6ea9164c9024dae8934ddc6db9712b4 |