Skip to main content

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


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)

Uploaded Source

Built Distribution

confdoggo-0.1.0a1-py3-none-any.whl (24.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page