hjson
Hjson, a user interface for JSON.
What it is and what it does
hjson is a Python parser and encoder for Hjson, a human-friendly variant of JSON that allows comments, unquoted keys, trailing commas, and other relaxations to make configuration files and data more readable. It provides `loads()` and `dumps()` functions to convert between Hjson text and Python objects, plus `dumpsJSON()` to output strict JSON. The package has no runtime dependencies and works as a pure Python library.
It's useful when you want JSON-like data structures but need the flexibility of comments and relaxed syntax for configuration files or hand-edited data. The package includes a command-line tool for converting between Hjson and JSON formats. However, maintenance is aging—the last release was in 2022—so it may not receive updates for newer Python versions or security issues.
Use it for:
- Parse configuration files written in Hjson format with comments and unquoted keys instead of strict JSON.
- Convert human-written Hjson data to Python objects or standard JSON for downstream processing.
- Use the command-line tool to validate or reformat Hjson files to JSON on the fly.
- Embed Hjson parsing in applications that accept user-friendly configuration syntax.
- Store structured data with inline comments in a format more readable than JSON.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses and generates Hjson (a human-friendly JSON variant with comments, unquoted keys, and relaxed syntax) and converts between Hjson and standard JSON formats.
Yes, if you need Hjson support and accept the aging maintenance status. The package is stable, has no known vulnerabilities, and carries no install friction. However, verify that it supports your target Python version, since classifiers only list up to 3.5 and the last release was 2022; for modern Python projects, confirm compatibility before committing to it.
Install
hjson on PyPI
pip
pip install hjsonuv
uv add hjsonpoetry
poetry add hjsonInstalling hjson
Before you install
Low install friction with no runtime dependencies. Maintenance is aging—last release was in 2022 and the last commit in 2025, with no recent activity signals, though the package remains stable and archived status is false.
License in practice
Licensed under MIT License (permissive), allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install hjson
import hjson
text = '{foo: a, bar: 1}'
result = hjson.loads(text)
print(result) # OrderedDict([('foo', 'a'), ('bar', 1)])
Verify before relying
- Whether the package is actively maintained or if aging status indicates it may not receive security updates or bug fixes going forward.
- Current compatibility with modern Python versions beyond those listed in classifiers (3.5 was the latest listed; current support is unspecified).
Package facts
| License | MIT License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 1,462 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,543,005/month — #2,078 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hjson-3.1.0-py3-none-any.whl
Keywords: json, comments, configuration
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
dirtyjsonParses JSON-like data from files containing…
permissive · top 5,000 on PyPI
pyhoconParses HOCON (Human-Optimized Config Object…
permissive · top 5,000 on PyPI
ujsonUltra-fast JSON encoding and decoding in pure C…
permissive · top 1,000 on PyPI
perkyPerky parses a minimal, human-friendly text…
permissive · top 15,000 on PyPI
json5kitParses JSON5 (JSON with comments, trailing…
permissive · top 15,000 on PyPI
json-tricksExtends Python's JSON serialization to handle…
permissive · top 15,000 on PyPI
partialjsonParses incomplete or malformed JSON strings…
permissive · top 15,000 on PyPI
simplejsonsimplejson encodes Python objects to JSON and…
permissive · top 1,000 on PyPI
json5Parses and writes JSON5 data format, which…
permissive · top 1,000 on PyPI
jstylesonParses JSON strings that contain…
permissive · top 15,000 on PyPI