Skip to main content

Configuration framework in Python for general configuration use.

Project description

Alchemy Config

The aconfig library provides simple yaml configuration in python with environment-based overrides.

Installation

To install, simply use pip

pip install alchemy-config

Quick Start

config.yaml

foo: 1
bar:
    baz: "bat"

main.py

import aconfig

if __name__ == "__main__":
    config = aconfig.Config.from_yaml("config.yaml")
    print(config.foo)
    print(config.bar.baz)
export BAR_BAZ="buz"
python3 main.py

Corner-case Behavior

You CAN set builtin method names as attributes on the config. However, you should only access/delete them via dictionary access methods.

For example:

import aconfig
cfg = {"update": True}

config = aconfig.Config(cfg)

# DO NOT DO THIS:
config.update

# DO THIS INSTEAD:
config["update"]

This is because there is no way in Python to tell whether you want the method or the attribute "update" when "getting" it from the object.

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

alchemy-config-1.1.3.tar.gz (10.7 kB view hashes)

Uploaded Source

Built Distribution

alchemy_config-1.1.3-py3-none-any.whl (7.3 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