Skip to main content

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

Release files for hjson 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hjson 3.1.0
File Size Uploaded
hjson-3.1.0.tar.gz 40.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hjson 3.1.0
File Interpreter ABI Platform
hjson-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 94.6 kB

Release files / hjson-3.1.0.tar.gz

Download URL hjson-3.1.0.tar.gz
Size 40.5 kB
Tags Source
SHA-256 checksum
How to use checksums
55af475a27cf83a7969c808399d7bccdec8fb836a07ddbd574587593b9cdcf75
BLAKE2b-256 checksum
How to use checksums
82e50b56d723a76ca67abadbf7fb71609fb0ea7e6926e94fcca6c65a85b36a0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / hjson-3.1.0-py3-none-any.whl

Download URL hjson-3.1.0-py3-none-any.whl
Size 54.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65713cdcf13214fb554eb8b4ef803419733f4f5e551047c9b711098ab7186b89
BLAKE2b-256 checksum
How to use checksums
1f7f13cd798d180af4bf4c0ceddeefba2b864a63c71645abc0308b768d67bb81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

3.1.0 This release

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

1 release file

2.0.7

1 release file

2.0.2

1 release file

2.0.0

1 release file

1.5.8

1 release file

1.5.7

1 release file

1.5.6

1 release file

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.0

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page