Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

jceresini/configinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

configinator

A simple config loading library. Allows access to config items using dot-notation, which I find easier to read. The config object can be created by passing a dictionary to the constructor, or via a static function that loads config from a json-formatted file. Also has built-in support for decoding base64 config items.

Build Status

Examples

Sample config file

{
  "some_username": "foo"
  "some_password": "bar",
  "some_secret_key": "TxPHiAEyU0qlUivc71HVB5gj2USpVvMH",
  "b64:some_complicated_thing": "dGhlIHF1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZwo=",
}

Loading the config data

from configinator import Config

config = Config.load_from_file('/app/secrets/config.json')

print(config.some_username)
# foo

print(config.some_password)
# bar

print(config.some_secret_key)
# TxPHiAEyU0qlUivc71HVB5gj2USpVvMH

print(config.some_complicated_thing)
# the quick brown fox jumps over the lazy dog

About

Simple library for loading and accessing config

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages