Python configs for humans. Using OS environment.
Project description
Python configs for humans.
Using OS environment.
Before you ask - this library doesn't support type-casts and other features. Just env parsing.
How to?
At first, install libary:
pip install betterconf
And... write simple config:
from betterconf import field, Config
class MyConfig(Config):
my_var = field("my_var")
cfg = MyConfig()
print(cfg.my_var)
Try to run:
my_var=1 python our_file.py
With default values:
from betterconf import field, Config
class MyConfig(Config):
my_var = field("my_var", default="hello world")
cfg = MyConfig()
print(cfg.my_var)
# hello world
Override values when it's needed (for an example: test cases)
from betterconf import field, Config
class MyConfig(Config):
my_var = field("my_var", default="hello world")
cfg = MyConfig(my_var="WOW!")
print(cfg.my_var)
# WOW!
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
betterconf-1.1.tar.gz
(3.0 kB
view hashes)