Metadata-Version: 2.4
Name: pyzon
Version: 0.1.1
Summary: Zig Object Notation parsing library written in pure Python
Project-URL: Repository, https://codeberg.org/Jan200101/pyzon.git
Project-URL: Bug Tracker, https://codeberg.org/Jan200101/pyzon/issues
Author: Jan Drögehoff
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Requires-Python: >=3.8
Provides-Extra: all
Requires-Dist: mypy; extra == 'all'
Requires-Dist: pytest; extra == 'all'
Requires-Dist: pytest-cov; extra == 'all'
Requires-Dist: ruff; extra == 'all'
Requires-Dist: tox; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: tox; extra == 'test'
Description-Content-Type: text/markdown


# PyZon

a standalone python parser for the Zig Object Notation format from the [Zig Programming Language](https://ziglang.org/).

At the moment the library only supports reading Zon file

## How to use
```py
import pyzon

with open("build.zig.zon") as fp:
    pyzon.load(fp)
# {.name: .zig, .version: '0.0.0', .dependencies: {.standalone_test_cases: {.path: 'test/standalone'}, .link_test_cases: {.path: 'test/link'}}, .paths: [''], .fingerprint: 13965117641364839958}

pyzon.loads(".{1, .b, \"b\", 'c'}")
# [1, .b, 'b', 'c']

pyzon.dumps({"name": pyzon.EnumLiteral("test"), "version": "0.0.0"})
# '.{.name = .test, .version = "0.0.0"}'
```

## Limitations
PyZon was only intended to ever parse `build.zig.zon` files and may not support everything expressable within a Zon file however it is also a bit more lax and can parse zon files that Zig itself will reject, for example in the case of keywords being used in literals.

If you find a zon file that does not parse correctly please open an issue to document this and give me the ability to fix it.

## License
PyZon uses the MIT License
