Skip to main content

jcson - enhanced json for configuration

Project description

jcson - enhanced json for configuration

Build Status

Introdcution

The jcson python module is an enhanced json parser, that supports:

  • path expression sustitutions, a way of referring to other parts of the json/dictionary tree
  • include directive
  • new line and inline comments

Instaling

Install and update using pip:

pip install -U jcson

A simple example

Sample config file simple.jcson:

{
    "foo" : {
        "bar": "some value"
    },

    "bar_value": "${foo.bar}",

    "concatenated": "${foo.bar} used later"
}

Pyhton code that reads it:

import json
import jcson

c = jcson.read('simple.jcson')

print (json.dumps(c, indent=4))

Output:

{
    "foo" : {
        "bar": "some value"
    },

    "bar_value": "some value",

    "concatenated": "some value used later"
}

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

jcson-0.1.3.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

jcson-0.1.3-py3-none-any.whl (5.0 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