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.

Source Distribution

jsonfig-0.1.1.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file jsonfig-0.1.1.tar.gz.

File metadata

  • Download URL: jsonfig-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jsonfig-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1f7b6dcd8fb4f42010bef79b26bc9e023e7aa4f8db0d9d2f2dbc7c2c6bb7c60e
MD5 d5a66cf09ec21665e6a6bb76bd5a6e17
BLAKE2b-256 a279cfc64cdc1f2a1487eb48037530ae35c4a6a0f6953749472712e9b94dbbe8

See more details on using hashes here.

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