Skip to main content

This is an easy way to a configuration file in json format.

Project description

ezconfiguration

PyPI Latest Release Downloads Repo Size License Release Date

What is ezconfiguration?

ezconfiguration is a Python package for building a configuration file in an easy way.

Where to get ezconfiguration

The source code is currently hosted at GitHub:
https://github.com/datanooblol/ezconfiguration

The latest version is available at
Python Package Index (PyPI)

# pip  
pip install ezconfiguration  

How to use ezconfiguration

Steps to follow:

# Import EzPackage
from ezconfiguration.config_manager import EzConfig

# Initialize EzConfig object
ezcfg = EzConfig(directory='your-desired-directory', filename='filename.json')

# Write a configuration file. If file already exists, replace=True
ezcfg.write_config_file(config_dict={"a":1})

# Read a configuration file. It's a good practice to use this method after writing, inserting, updating, deleting method.
ezcfg.read_config_file()

# Insert a new configuration. If a config already exists, replace=True
ezcfg.insert_config(config_dict={'b':[2,3,4]})

ezcfg.read_config_file()

# Update the existing configuration. Always replace=True
# Note: in the case when you want to update the nested configuration, use insert method with the whole nested config instead
ezcfg.update_config(key='a', value=5, replace=True)

ezcfg.read_config_file()

# Delete a configuration. Input delete config
ezcfg.delete_config(key='b')

ezcfg.read_config_file()

# Delete the configuration file. Input permanently delete
ezcfg.delete_config_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

ezconfiguration-0.0.2.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

ezconfiguration-0.0.2-py3-none-any.whl (5.2 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