Skip to main content

HOCON parser for python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hocon2-0.6.3.tar.gz (50.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hocon2-0.6.3-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file hocon2-0.6.3.tar.gz.

File metadata

  • Download URL: hocon2-0.6.3.tar.gz
  • Upload date:
  • Size: 50.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hocon2-0.6.3.tar.gz
Algorithm Hash digest
SHA256 2ffa6a6646c32d4f08bcca0bbe63b9acb6c8222faf159d22bbc18484853ce38e
MD5 c995509ac41b77d4f67c2b50e6e12e63
BLAKE2b-256 9719ad4d67bff56f277f9961ae93766ecf2f4ccecd37bfd7fd441b82d37bede2

See more details on using hashes here.

File details

Details for the file hocon2-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: hocon2-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hocon2-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7ce6cde29aa494b9e37a215ecd609e7dba8271135c80fa6941cbe263673d8218
MD5 4fbdb93b88d6c6ae781d19c7eafa7ddd
BLAKE2b-256 91f63f1a10ca5c428087b5e044d5e452ed21b32df547b829d7b72688cdbf2b38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page