Skip to main content

HOCON parser with json-like interface

codecov

Usage

Just like with json, you can load data from a file or from a string to python dict/list:

import hocon

data = """
animal.favorite: badger
key : ${animal.favorite} is the best
"""
dictionary = hocon.loads(data)

And dump it back to string to your favorite format:

>>> import yaml
>>> print(yaml.dump(dictionary))
animal:
  favorite: badger
key: badger is the best

Specification

This library has NOT implemented each and every statement in the hocon specification.

Check FEATURES.md to see which HOCON functionalities are already implemented and tested.

Why choose hocon2?

  • Simple interface
  • Modern, fully py.typed design
  • Tested on each change against:
    • black
    • mypy --strict
    • ruff
    • pylint
    • ALL conf examples from hocon specification
    • 100% code coverage
    • typeguard (dynamic typechecks)
  • Tested on demand against hypothesis generated confs
  • Fixed a lot of issues still lingering in pyhocon

Why choose pyhocon?

  • You use python < 3.11
  • You need a HOCON writer - hocon2 can only READ
  • hocon2 is still in version 0.X.X, it might break backwards compatibility until version 1.0.0
  • hocon2 has almost no users and no public issues raised so far (PROBABLY CONTAINS UNDISCOVERED BUGS)
  • hocon2 is developed by a single person, responsiveness to issues and support might be worse than pyhocon

Metadata

Release files for hocon2 0.6.3

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

Source distribution (sdist)

Source distribution for hocon2 0.6.3
File Size Uploaded Provenance Actions
hocon2-0.6.3.tar.gz 50.8 kB Without provenance Details for hocon2-0.6.3.tar.gz

Built distribution (wheel)

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

Total release size: 79.1 kB

Release files / hocon2-0.6.3.tar.gz

Download URL hocon2-0.6.3.tar.gz
Size 50.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ffa6a6646c32d4f08bcca0bbe63b9acb6c8222faf159d22bbc18484853ce38e
BLAKE2b-256 checksum
How to use checksums
9719ad4d67bff56f277f9961ae93766ecf2f4ccecd37bfd7fd441b82d37bede2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / hocon2-0.6.3-py3-none-any.whl

Download URL hocon2-0.6.3-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ce6cde29aa494b9e37a215ecd609e7dba8271135c80fa6941cbe263673d8218
BLAKE2b-256 checksum
How to use checksums
91f63f1a10ca5c428087b5e044d5e452ed21b32df547b829d7b72688cdbf2b38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for hocon2 0.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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