a native cpython extension to parse zig object notation strings
Project description
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.
Usage
install from source on pypi:
pip install zig-zon
running:
import zig_zon
parsed = zig_zon.parse('.{.allyourcode = .are_belong_to_us, .asd = 123}')
print(parsed)
or, look at the test file
How it works
When you run pip install, the source distribution is downloaded, and since
this package depends on the ziglang as well as my setuptools helper package:
setuptools-zig-build
to execute zig build and put the resulting library in the wheel.
Developing
as opposed to other solutions for building cpython extensions in zig, i want to develop this using:
zig build test --watch
for linking against the local python installation setuptools-zig-build
runs a python script that imports the cpython headers into zig's build cache.
When the module is built using pip, zig will get a -Dpython= option pointing to the correct python executable,
otherwise system python in PATH is used.
pip installation also uses a -Dversion= option for the pip package version.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file zig_zon-0.1.3.tar.gz.
File metadata
- Download URL: zig_zon-0.1.3.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6da32726b17832d3c3ab207cc1345fc87a28a71167718e17f78481a8d19d892
|
|
| MD5 |
6d9a5b4aa8b1bb3cf743eb3ffa39d0cf
|
|
| BLAKE2b-256 |
ea03183651d7550af83967dc48d5582a5c5574e3d4e55b9ff67a84b387416e9c
|