{"id":13741209,"url":"https://github.com/adamserafini/zaml","last_synced_at":"2025-09-07T15:33:24.631Z","repository":{"id":39904493,"uuid":"477306158","full_name":"adamserafini/zaml","owner":"adamserafini","description":"🚀  Fast YAML 1.2 parsing library for Python 3","archived":false,"fork":false,"pushed_at":"2023-12-12T18:24:52.000Z","size":85,"stargazers_count":104,"open_issues_count":5,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-26T16:08:55.380Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamserafini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-04-03T10:23:24.000Z","updated_at":"2024-12-22T16:37:41.000Z","dependencies_parsed_at":"2024-04-17T10:53:21.112Z","dependency_job_id":"d6c16ba3-7877-40ec-85f1-1ec48e80cc19","html_url":"https://github.com/adamserafini/zaml","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":"0.33333333333333337","last_synced_commit":"eef4558e6c66037e2006f185bb6e3b322e0ac7fb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamserafini%2Fzaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamserafini%2Fzaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamserafini%2Fzaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamserafini%2Fzaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamserafini","download_url":"https://codeload.github.com/adamserafini/zaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232227761,"owners_count":18491732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:56.798Z","updated_at":"2025-01-02T17:12:44.920Z","avatar_url":"https://github.com/adamserafini.png","language":"Zig","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# 🚀 zaml\nFast YAML 1.2 parsing library for Python 3.6+ 🐍\n\n## What's This?\n\nProof-of-concept for my PyCon DE 2022 [talk](https://2022.pycon.de/program/DFWSQR/), \n[video](https://www.youtube.com/watch?v=O0MmmZxdct4), \n**Speeding Up Python with Zig**, not yet recommended for production use!\n\nLibrary with the following objectives:\n - [x] Written in pure Zig, importing `Python.h` headers directly, no FFI, `ctypes` or `cffi`.\n - [x] Compiled using the Zig toolchain / CLI, no other tool (eg. `clang`) required.\n - [x] Tested to be compatible with mac OSX, Linux and Windows.\n - [x] Installable via PyPI\n - [ ] Should not require Zig toolchain locally in order to install and use.\n - [ ] Fastest available YAML 1.2 parser for Python.\n\nHelp wanted to achieve the full objectives, PRs welcome.\n\n### Installation\n\n```\npip install zaml\n```\n\n**Note**: currently source distribution only, ie. `sdist` - no binary `wheels` (yet), therefore requires Zig 0.10.0 \ninstalled locally. Any other Zig version is untested.\n\n### Installing Locally\n\nSome pre-requisites (linting etc.), `pyenv` also recommended:\n```bash\npre-commit install\npre-commit run --all-files\n```\n\nThe simplest possible extension module is a module with one function, that takes no arguments and returns an integer. \nThis repo demonstrates a pure Zig module that does exactly that:\n\n```bash\npython -m venv .venv\nsource .venv/bin/activate\npip install -e .\n```\n\n### Tests\n\nTests that the most basic possible Zig extension can in-fact be installed and returns the expected result:\n\n```bash\npython test.py\n```\n\n### Benchmark\n\nTo run a benchmark of the current `zaml` prototype (also runs in CI and asserts that the YAML structure is correctly \nparsed):\n```bash\ncd benchmark\npython benchmark.py\n```\n\nResults on my 2,3 GHz Quad-Core Intel Core i7 Mac:\n\n```bash\nRunning benchmarks...\n\nBenchmark results:\nzaml took 0.89 seconds\nPyYAML CSafeLoader took 13.36 seconds\nruamel took 38.86 seconds\nPyYAML SafeLoader took 81.78 seconds\n```\n\n### Credits\n\nWould not exist without [kubkon's](https://github.com/kubkon), `zig-yaml`: https://github.com/kubkon/zig-yaml\n\n### Cross-platform Local Testing\n\n#### Linux\n\nTo test in Linux, the easiest way is probably to use Docker:\n\n```bash\ndocker run --name zaml -v $PWD:/root/zaml -it fedora\n```\n\nThis kicks you into a shell in a running a container with this library mounted in\nthe `/root/zaml` directory. Changes you make on your host machine will be immediately\nreflected in the container.\n\nInstall Python 3 headers, zig and test the library:\n\n```bash\ndnf install zig python3-devel\ncd /root/zaml\npython3 -m venv .venvlinux\nsource .venvlinux/bin/activate\npip install -e .\n```\n\nTo re-attach to the container after exiting:\n\n```bash\ndocker start -ia zaml\n```\n\n#### Windows\n\nTo test in Windows from a Mac, the easiest way I have found is to use [Parallels](https://www.parallels.com/).\n\n#### MacOSX\n\nI am writing this `README` on a Mac. Consequently, I have not attempted testing this library in MacOSX from another\noperating system host. If you manage this, please do add documentation about it here.\n\n### Publishing to PyPI\n \n**Note**: Temporary instructions (until full CI setup).\n\nYou may need to upgrade `build` and `twine` (with your `virtualenv` activated):\n\n```\npython -m pip install --upgrade build\npython -m pip install --upgrade twine\n```\n\nThen:\n\n```\nrm -rf dist\npython3 -m build --sdist\npython3 -m twine upload --repository pypi dist/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamserafini%2Fzaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamserafini%2Fzaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamserafini%2Fzaml/lists"}