Skip to content

jiejie-dev/oneconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OneCofnig

A config lib for python.

Installation

pip install oneconfig

Usage

For example, there is a config file named appsettings.Development.json

from oneconfig.cores import Configuration

class MyConfig(Configuration):
    port = 8080
    domain = "localhost"
    
myconfig = MyConfig()
myconfig.add_file_by_prefix("appsettings") # it will loads all config files startswith `appsettings`
print(MyConfig.domain) # localhost 

myconfig.mode = 'Production'
myconfig.add_file_by_prefix("appsettings", follow_mode=True)
print(MyConfig.domain) # empty

LICENSE

The MIT License (MIT)

Copyright (c) 2018 jeremaihloo

About

A config lib for python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages