ppc64le/linux/: hjson-3.0.2 metadata and description

Homepage Simple index

Hjson, a user interface for JSON.

author Christian Zangl
author_email [email protected]
classifiers
  • Development Status :: 5 - Production/Stable
  • Intended Audience :: Developers
  • License :: OSI Approved :: MIT License
  • License :: OSI Approved :: Academic Free License (AFL)
  • Programming Language :: Python
  • Programming Language :: Python :: 2
  • Programming Language :: Python :: 2.6
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.3
  • Programming Language :: Python :: 3.4
  • Programming Language :: Python :: 3.5
  • Programming Language :: Python :: Implementation :: CPython
  • Programming Language :: Python :: Implementation :: PyPy
  • Topic :: Software Development :: Libraries :: Python Modules
  • Environment :: MetaData :: IBM Python Ecosystem
keywords json comments configuration
license MIT License
File Tox results History
hjson-3.0.2-py3-none-any.whl
Size
178 KB
Type
Python Wheel
Python
3

hjson-py

Hjson, a user interface for JSON

Hjson works with Python 2.5+ and Python 3.3+ (based on simplejson)

Installation

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

hjson-py

Export Classification Notice

The software hosted on this website consists of publicly available open‑source packages. To the extent U.S. export regulations apply, software that is publicly available as described in 15 C.F.R. §§ 734.7 (for non-encryption software) or 742.15(b) (for encryption software) is not subject to the Export Administration Regulations (EAR). Users are responsible for complying with all applicable export laws and regulations.