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.1.tar.gz (12.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: zig_zon-0.1.1.tar.gz
  • Upload date:
  • Size: 12.5 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.1.tar.gz
Algorithm Hash digest
SHA256 189bed773a16cf0383bfc956ad320c7a97edbe87db2a5fb110027cf977b0f1e3
MD5 c63ebcbde28de8c35a7efbde49d1e7ba
BLAKE2b-256 31dd6b5d409edcf943b70b5f6f6e38103b7afbad3176014d45887c9bc50e9714

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