A light and global config for research, MVPs and prototype projects.
Project description
Light Config (lco)
Load a config file once and use it as you would use enviroment variables from anywhere in your code.
Somewhere:
import lco
lco.init("some_config.yml")
You can also set the enviroment variable LCO_CONFIG
instead.
Somewhere else entirely, 10 layers deep in some object.
import lco
lco["some_value"]
lco["some_group"]["some_value"]
This works across threads and processes.
But why?
This is mostly useful for research code, MVPs or Prototypes, where on doesn't want to pass configuration variables from object to object or across scopes. I wouldn't recommend this for production code as you're essentially using global variables.
What filetypes are supported?
So far, only yaml. Feel free to open a pull request with the filetype of your choice.
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
Built Distribution
File details
Details for the file lco-0.1.0.tar.gz
.
File metadata
- Download URL: lco-0.1.0.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.3.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fff7a8c64c1dd0c218374add3cc2db4428083c5573684259cbe6b6f8b81d7aed |
|
MD5 | 75d22fc3edbdbdfb52bd8804f289ed7e |
|
BLAKE2b-256 | 442b933ead4581f473c641181af604465b4e5046a4f1adbf45fe8d5f772ff7fd |
File details
Details for the file lco-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: lco-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.3.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95201b638fdbadc9345ab1e848e96c490bc2a334619b4b678b76b747a2294de5 |
|
MD5 | 7d3830eca05b859bc7261397442f1b67 |
|
BLAKE2b-256 | 3d5801c7bf43adb81ba3099abdd4ea94b70d8bfd46e294e9140ff37cb9c77ead |