Skip to main content

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
print(ezcfg.myfirstconfig)
# "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
ezcfg.load_config_from_json_file('myconfigpath.json')

# 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
ezcfg.load_config_from_env()

automatic type checking

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

status

Build Status

Release files for ezcfg 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ezcfg 0.1.3
File Size Uploaded
ezcfg-0.1.3.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ezcfg 0.1.3
File Interpreter ABI Platform
ezcfg-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / ezcfg-0.1.3.tar.gz

Download URL ezcfg-0.1.3.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b929c4036f253c5d00eeb7034c610bd455fcd1c9d9304ef95c18d3ddeab2cf15
BLAKE2b-256 checksum
How to use checksums
402e55e88b2a1d6928c235ec142571318220b0930b72d7ac1210923c8f13a2b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Release files / ezcfg-0.1.3-py3-none-any.whl

Download URL ezcfg-0.1.3-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8bfd0b9460b2307e0bf277f9125d21fbba4db0c13dec47f9f40a39bdd785d34
BLAKE2b-256 checksum
How to use checksums
0c0bd5103a6ca5e7fa6c4301992d643ec975b1fea3e7ae9fa40563c1a0148640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page