Metadata-Version: 2.4
Name: zig-zon
Version: 0.2.0
Summary: 
Description-Content-Type: text/markdown

# Python Zig Zon Parser

A native python extension built with zig to parse zig-object-notation strings
into python objects.

On PyPi it is only distributed in source, and built during install.
It therefore needs to download the `ziglang` python package.

Depending on your OS, you may need the python development headers
(e.g. `python3-dev`) installed.

## Usage

install from source on pypi:

```bash
pip install zig-zon
```

running:

```python
import zig_zon
parsed = zig_zon.parse('.{.allyourcode = .are_belong_to_us, .asd = 123}')
print(parsed)
```

or, look at the [test file](https://codeberg.org/dasimmet/python-zig-zon/src/branch/main/src/test_zig_zon.py)

## How it works

The `zig build` commands produces a python source distribution archive ready
for uploading to Pypi. It includes the sources of [zig-python-sdist](https://codeberg.org/dasimmet/zig-python-sdist)
and a custom `setup.py` that handles the build of the cpython extension.

When you run pip install, the source distribution is downloaded, and since
this source distribution depends on the `ziglang` python package at build time,
a `zig build` command is used to compile the extension.

## Developing

as opposed to other solutions for building cpython extensions in zig,
i want to develop this using:

```
zig build
```

for linking against the local python installation [zig-python-sdist](https://codeberg.org/dasimmet/zig-python-sdist)
runs a python script that imports the cpython headers into zig's build cache,
run `translate-c` on the result and offers a `cpython` module to import
in our zig code.
On windows, the extension library is also linked against
the python runtime static lib and renamed to a `.pyd` file for importing.
