HOCON parser for python
Project description
HOCON parser with json-like interface
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hocon2-0.6.2.tar.gz.
File metadata
- Download URL: hocon2-0.6.2.tar.gz
- Upload date:
- Size: 50.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e157deb5c4657f6c05737062f53396cd86d6594569f6874da9b335fa5f2744fe
|
|
| MD5 |
5886f974782b917d29dc03f40b555a30
|
|
| BLAKE2b-256 |
f9b46af9c1c2e7f53285f6042776e7a52d22855879eebb7cd0c8e781e9c2436b
|
File details
Details for the file hocon2-0.6.2-py3-none-any.whl.
File metadata
- Download URL: hocon2-0.6.2-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0725d8d8838be808c9a6470c760bf27844bcc39aa9ee42cce61c70d8e9053258
|
|
| MD5 |
1c0260f9b7611ec4ccdd0c7a480734c3
|
|
| BLAKE2b-256 |
7cb51c9058b2f63b55ecb35b1b29419bb3385f2aecc26d892092a2a9a8c81d31
|