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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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

Hashes for confdoggo-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 c448d9f1bc4d6878f9035f5652f05b565a074a813b1263be9c7285a1df8c028e
MD5 c2f70b75954f2b222c0ae7f550f63099
BLAKE2b-256 ab680e5078549b1d05094d7f9ebe66b732e682d11e590090e4c423441ee3629e

See more details on using hashes here.

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

Hashes for confdoggo-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a65a1d455413481cc96f13dccd04d0641e040d3e5f5b264137e559f3e4e2a5ae
MD5 cff6bae5c795b49e1ae5b4798daff582
BLAKE2b-256 6d58811d05c2c7003f18da38c98d46f8d6ea9164c9024dae8934ddc6db9712b4

See more details on using hashes here.

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