Hjson, a user interface for JSON.
Project Links
Meta
Author: Christian Zangl
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
License
- OSI Approved :: MIT License
- OSI Approved :: Academic Free License (AFL)
Programming Language
- Python
- Python :: 2
- Python :: 2.6
- Python :: 2.7
- Python :: 3
- Python :: 3.3
- Python :: 3.4
- Python :: 3.5
- Python :: Implementation :: CPython
- Python :: Implementation :: PyPy
Topic
- Software Development :: Libraries :: Python Modules
hjson-py
Hjson, a user interface for JSON
Hjson works with Python 2.5+ and Python 3.3+ (based on simplejson)
Installation
pip install hjson
or download from https://pypi.python.org/pypi/hjson
Commandline
Usage: hjson [options] hjson [options] <input> hjson (-h | --help) hjson (-V | --version) Options: -h --help Show this screen. -j Output as formatted JSON. -c Output as JSON. -V --version Show version.
E.g. echo '{"json":"obj"}' | hjson
Usage
import hjson
Decoding Hjson
text = """{
foo: a
bar: 1
}"""
hjson.loads(text)
Result:
OrderedDict([('foo', 'a'), ('bar', 1)])
Encoding Python object hierarchies
hjson.dumps({'foo': 'text', 'bar': (1, 2)})
Result:
{ foo: text bar: [ 1 2 ] }
Encoding as JSON
Note that this is probably not as performant as the simplejson version.
hjson.dumpsJSON(['foo', {'bar': ('baz', None, 1.0, 2)}])
Result: '["foo", {"bar": ["baz", null, 1.0, 2]}]'
API
Aug 13, 2022
3.1.0
Sep 15, 2020
3.0.2
Oct 27, 2017
3.0.1
Jul 17, 2017
3.0.0
Jun 09, 2017
2.0.7
Aug 19, 2016
2.0.2
Aug 02, 2016
2.0.0
Jul 18, 2016
1.5.8
Jul 18, 2016
1.5.7
Apr 29, 2016
1.5.6
Apr 26, 2016
1.5.5
Apr 19, 2016
1.5.4
Feb 04, 2016
1.5.3
Aug 21, 2015
1.5.2
May 06, 2015
1.5.0
Jan 17, 2015
1.4.1
Jan 14, 2015
1.4.0
Jan 12, 2015
1.3.0
Jan 09, 2015
1.2.0
Jan 08, 2015
1.1.0
Jan 05, 2015
1.0.1
Jan 05, 2015
1.0.0
Wheel compatibility matrix
Files in release
No dependencies