Skip to main content

JSON configuration file parser

Project description

configpy is a JSON configuration file reader with support for variable look-ahead and look-behind, expressions, and comments.

Example

config_json = """
/* Some example configuration items */
{
    "a": 10,
    "b": 2,
    "c": "{{ ${a} / ${b} }}",
    "d": "{{ ${c} * ${a} }}",
    "e": "{{ ${d} + 50 }}",
    "f": "{{ ${e} - 25 }}",
    "g": "'some text = {{ ${a} / ${b} }}'"
}
"""

config = Config(config_json)
10 == config.a
2 == config.b
5 == config.c
50 == config.d
100 == config.e
75 == config.f
"some text = 5" == config.g

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
configpy-0.5.tar.gz (6.1 kB) Copy SHA256 hash SHA256 Source None Jun 2, 2010

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page