Skip to main content

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


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)

Uploaded Source

Built Distribution

ConfigJ-1.0.0-py3-none-any.whl (2.5 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