Skip to main content

Simple JSON auto-reloading configuration

Project description

=======
jsonfig
=======

Simple autoreloading configuration files in JSON. Will use the very fast UltraJSON library for parsing if available.

Installation
============

$ pip install jsonfig

Usage
=====

Create a JSON file whose root is a dictionary:

{
"always_load_user_data": true,
"use_new_feature_123": false,
"feature_456_chance": 0.20
}

Now it can be loaded as a dictionary:

>>> config = jsonfig.from_path("example.json")
>>> config["feature_456_chance"]
0.20

By default, when the file is changed, it will be automatically reloaded within one second:

{
"always_load_user_data": true,
"use_new_feature_123": false,
"feature_456_chance": 1.0
}

Now the new value will show up in the config structure:

>>> config["feature_456_chance"]
1.0

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 jsonfig, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size jsonfig-0.1.1.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page