Skip to main content

Python bindings for dhall, a functional configuration language

Project description

Dhall Logo

Maintenance CI status PyPI version shields.io PyPI pyversions

Dhall is a programmable configuration language optimized for maintainability.

You can think of Dhall as: JSON + functions + types + imports

Note that while Dhall is programmable, Dhall is not Turing-complete. Many of Dhall's features take advantage of this restriction to provide stronger safety guarantees and more powerful tooling.

You can try the language live in your browser by visiting the official website:

dhall-python

dhall-python contains Dhall bindings for Python using the rust implementation. It is meant to be used to integrate Dhall into your python applications.

If you only want to convert Dhall to/from JSON or YAML, you should use the official tooling instead; instructions can be found here.

Usage

Install using pip:

python3 -m pip install --user dhall

Supports Windows, Mac OS, and Linux (with libssl.so.1 and libcrypto.so.1)

python-dhall implements a similar API to Python's json module:

>>> import dhall
>>> dhall.dumps({"keyA": 81, "keyB": True, "keyC": "value"})
'{ keyA = 81, keyB = True, keyC = "value" }'
>>> dhall.loads("""{ keyA = 81, keyB = True, keyC = "value" }""")
{'keyA': 81, 'keyB': True, 'keyC': 'value'}

License

python-dhall is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in python-dhall by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

All contributions are welcome! If you spot any bugs, or have any requests, issues and PRs are always welcome.

Developer guide

This project uses poetry for managing the development environment. If you don't have it installed, run

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
export PATH="$HOME/.poetry/bin:$PATH"

The project requires the nightly version of Rust.

Install it via rustup:

rustup install nightly

If you have already installed the nightly version, make sure it is up-to-date:

rustup update nightly

After that, you can compile the current version of dhall-python and execute all tests and benchmarks with the following commands:

make install
make test

🤫 Pssst!... run make help to learn more.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

dhall-0.0.3-cp39-none-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

dhall-0.0.3-cp39-cp39-manylinux2010_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

dhall-0.0.3-cp39-cp39-macosx_10_7_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

dhall-0.0.3-cp38-none-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

dhall-0.0.3-cp38-cp38-manylinux2010_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

dhall-0.0.3-cp38-cp38-macosx_10_7_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

dhall-0.0.3-cp37-none-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

dhall-0.0.3-cp37-cp37m-manylinux2010_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

dhall-0.0.3-cp37-cp37m-macosx_10_7_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

dhall-0.0.3-cp36-none-win_amd64.whl (2.2 MB view hashes)

Uploaded CPython 3.6 Windows x86-64

dhall-0.0.3-cp36-cp36m-manylinux2010_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

dhall-0.0.3-cp36-cp36m-macosx_10_7_x86_64.whl (2.0 MB view hashes)

Uploaded CPython 3.6m macOS 10.7+ x86-64

Supported by

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