Skip to main content

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


Download files

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

Source Distribution

zig_zon-0.1.2.tar.gz (13.7 kB view details)

Uploaded Source

File details

Details for the file zig_zon-0.1.2.tar.gz.

File metadata

  • Download URL: zig_zon-0.1.2.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for zig_zon-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d828d40d28747eb26711eb205d53c3e58a75fdbde140e36e3823414a8fd57b5a
MD5 883e596f58362603fec06ddfd98150f3
BLAKE2b-256 e65639e45ce69b63ffa920245aa140a43cd7e7fb7b694870c98d4d52a66ac0a2

See more details on using hashes here.

Supported by

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