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 details)
Built Distribution
File details
Details for the file confdoggo-0.1.0a1.tar.gz
.
File metadata
- Download URL: confdoggo-0.1.0a1.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.5 Linux/5.4.0-58-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c448d9f1bc4d6878f9035f5652f05b565a074a813b1263be9c7285a1df8c028e |
|
MD5 | c2f70b75954f2b222c0ae7f550f63099 |
|
BLAKE2b-256 | ab680e5078549b1d05094d7f9ebe66b732e682d11e590090e4c423441ee3629e |
File details
Details for the file confdoggo-0.1.0a1-py3-none-any.whl
.
File metadata
- Download URL: confdoggo-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.5 Linux/5.4.0-58-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a65a1d455413481cc96f13dccd04d0641e040d3e5f5b264137e559f3e4e2a5ae |
|
MD5 | cff6bae5c795b49e1ae5b4798daff582 |
|
BLAKE2b-256 | 6d58811d05c2c7003f18da38c98d46f8d6ea9164c9024dae8934ddc6db9712b4 |