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:

python3 -m 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

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, i want to develop using:

zig build test --watch

so setuptools-zig-build runs a python script that imports the cpython headers into zig's cache. When the module is built using pip, zig will get a -Dpython= option pointing to the right 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.0.tar.gz (7.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: zig_zon-0.1.0.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

Hashes for zig_zon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f610ac352355890b68f94857b31947e79abe254bd2fbe8904b494936fa4bf1fc
MD5 b5d037adb8c1fccdfda31455f1d59afa
BLAKE2b-256 37cbeb54bd8508b8419d08acd125c996595e78e7483d2ff2eb78d4e31397d22a

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