Skip to main content

Config data manager

Project description



Simple wrapper module for reading/writing config data like a native python dictionary. Multiple backends provide an identical interface to various file formats (change one line to switch between json & xml).

Data is arranged into sections, and then by key:value pairs (like a traditional .ini file). This arrangement is consistent across all backends and file formats. Keys must be strings, and values must be strings or values (int, float etc).

Supported Backends

  • ini
  • xml
  • json
  • yml (planned)
  • sqlite3 (planned)


Here is an example ini config file, "myconfig.ini".

username = Peter
id = 5531274123

type = mongodb
ip =

Example loading myconfig.ini, and manipulating the data.

from configg import Configg, XML_BACKEND, JSON_BACKEND

# Instantiate Configg
cfg = Configg("myconfig.ini")

# Pull data from user section
username = cfg.user["username"]

# Add data to the user section
cfg.user["token"] = "apples"

# Pull data from the database section
db_ip = cfg.database["ip"]

# Add new section, with new data
cfg.add_section("app_settings", {"resolution": "1024x768"})

# Remove section

# Commit local changes to file 

# Reload local data from file

# Create new xml config
cfg_xml = Configg("myconfig.xml", data_backend=XML_BACKEND)

# Create new xml config
cfg_json = Configg("myconfig.xml", data_backend=JSON_BACKEND)

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 configg, version 0.7b0
Filename, size File type Python version Upload date Hashes
Filename, size configg-0.7b0.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View
Filename, size configg-0.7b0-py3-none-any.whl (7.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

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