Skip to main content

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


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.0.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

ddv_settings-0.1.0-py3-none-any.whl (2.1 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