A json base config lib.
Project description
ConfigJ
A json base config lib.
Usage
from configj import ConfigJ, AbstractConfig
class ConfigData(AbstractConfig):
config1: str = 'Default Value'
config2: int = 166
cj = ConfigJ('config.json', ConfigData)
# Type hint
config: ConfigData
# when file not exists, create default config file and return it.
config = cj.load()
print(config.config1) # Default Value
config.config2 = 1 # set value
cj.save(config) # save config to file
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
ConfigJ-1.0.0.tar.gz
(2.0 kB
view hashes)