Skip to content

aka-toxa/py_configs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Config files

Config files is located on configs/ dir at root of your project. Each environment config should be file with json content. Each json file = separate environment config

configs/
|--- production.json
|--- local.json
|--- stage.json

ENV file

env file is located on root of your project. It needs to define your environment and load config file that belongs to your current environment

project_root
|--- .env

.env content:

production

DB configs

DB connection configs will be parsed from .my.cnf file located on home directory

Accessing to the configs

production.json:

{
  "somevar": "111",
  "somedict": {
    "somevar": "222"
  }
}
from configs import Config

configs = Config()

print(configs.get("somevar")) # 111
print(configs.get("somedict.somevar")) # 222

License

Released under MIT license

About

Python config manager.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages