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

Uploaded Source

Built Distribution

alchemy_config-1.1.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file alchemy-config-1.1.3.tar.gz.

File metadata

  • Download URL: alchemy-config-1.1.3.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for alchemy-config-1.1.3.tar.gz
Algorithm Hash digest
SHA256 526aeb77cd0c27c7b112ffb67e5af135c414e32dfbb4aa6dff45b5ca248e256d
MD5 b6107f8e9576d9c1b586dc0e943aa82e
BLAKE2b-256 3002718317d82c8db8846f072fb121bc90ebe3c0aca92e9893d644cc7cc75271

See more details on using hashes here.

File details

Details for the file alchemy_config-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: alchemy_config-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for alchemy_config-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60dfccd442533f3683428487de1b4650c2cb60f27e349186e5c88dd5ca204577
MD5 9de645c1f76317b53f67c611775e0778
BLAKE2b-256 8dfc3fbc6f626ac76e2e1f8fbe6c36057451184a133cdcb4d509569b08f2e1a8

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