This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A straightforward and unambiguous config file parser.

This package was originally based on the configparser module that comes in the standard python distribution but has been almost entirely rewritten.

The main branch won’t support python 2 as it is missing keyword only arguments and ChainMap is not in the standard library. If you need legacy support then there are a couple of forks which look like they do the job.

Installation

Available on pypi as json-config-parser

To install run

pip install json-config-parser

Alternatively grab the code from github and run:

python setup.py install

Syntax

Files are structured using square bracket sections, # comments and $key = $value options. Option values are written in json and can lists and dictionaries be spread over any number of lines. To keep parsing simple and files neat, comments, section headers and keys can not be indented and no whitespace is allowed on empty lines.

Comments start at the beginning of a line with a # symbol and extend to the line’s end.

Usage

cfg = JSONConfigParser()

cfg.read_string("""
[section]
number = 3.141592654
dictionary = {"key": "value"}
list = [1,
        2,
        3]
nested = {"list": [1,2,3]}
true = true
none = null

[DEFAULT]
# settings in the default section are inherited
# by all other sections.
default-setting = "default"
""")

# read a setting
cfg.get("section", "number")

# read a setting using index notation
cfg["section"]["true"]

# settings inherited from DEFAULT
cfg.get("section", "default-setting")

Bugs

Please report any problems on the bugtracker and I will do my best to fix them. Pull requests are also welcome.

Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
json-config-parser-0.1.2.tar.gz (2.1 kB) Copy SHA256 Checksum SHA256 Source Jan 20, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting