Skip to main content

Simple python configuration tool

Project description

Simple python configuration tool

ezcfg is a python package that allow you to easily maintain and access configuration throughout your project

  • easy registration of configuration
  • easy access to configuration
  • easy type validation of configuration
  • easy loading of configuration from json, ini, or environment variables

How to install

pip install ezcfg

How to use

register your first configuration

from ezcfg.config import ezcfg
ezcfg.register_config(name='myfirstconfig', config_type=str, default='configvalue')

# Access of configuration
# "configvalue"

load your config from ini, json, and environment variables

from ezcfg.config import ezcfg
ezcfg.register_config(name='myfirstconfig', config_type=str, default='configvalue')
# load config from json file

# load config from ini file
ezcfg.load_config_from_ini_file('myconfigpath.ini', section='DEFAULT')

# load config from environment variables
# you first need to set env_var name
ezcfg.register_config(name='myfirstconfig', config_type=str, default='configvalue', env_var='MYFIRSTCONFIG')
# this will load from MYFIRSTCONFIG env var

automatic type checking

from ezcfg.config import ezcfg
# will raise TypeError
ezcfg.register_config(name='myfirstconfig', config_type=int, default='configvalue')


Build Status

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ezcfg, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size ezcfg-0.1.3-py3-none-any.whl (3.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ezcfg-0.1.3.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page