Module for easily reading and exporting settings from files
Project description
DDV Settings
Module for easily reading and exporting settings from files
Example
settings.ini
[a]
b = c
d = e
[f]
g = h
j = k
Code that loads settings from settings.ini
and uses them:
import os
import sys
from ddv.settings import read, export
read("settings.ini")
export(sys.modules[__name__], True, "TEST")
print("Variable TEST_A_B == c")
print(TEST_A_B)
print("Env Var TEST_F_G == h")
print(os.environ.get("TEST_F_G"))
Output:
Variable TEST_A_B == c
c
Env Var TEST_F_G == h
h
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
ddv-settings-0.1.1.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for ddv_settings-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8d714ff8f5edb104a06d97730a545a64b859fce50028b370b5ad554a4271b8 |
|
MD5 | acd0d14f8cc0dc5e5778ba4524bdfc47 |
|
BLAKE2b-256 | 310ad3fbf80fbe9237d8c4747882f4e9d772d0989205db8cb5be0e32486574c6 |