Metadata-Version: 2.4
Name: yace
Version: 0.14.5
Summary: yace aka Yet Another Code Emitter / Your Artisanal Code Emitter
Author-email: "Simon A. F. Lund" <os@safl.dk>
Maintainer-email: "Simon A. F. Lund" <os@safl.dk>
License-Expression: GPL-2.0-only
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development
Classifier: Topic :: Text Processing
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Description-Content-Type: text/x-rst; charset=UTF-8
License-File: LICENSE
Requires-Dist: jinja2
Requires-Dist: pyyaml
Requires-Dist: pydantic<3.0,>=2.0
Requires-Dist: libclang~=14.0.1
Requires-Dist: black==26.10.1
Requires-Dist: clang-format==23.1.3
Requires-Dist: taplo==0.9.3
Provides-Extra: dev
Requires-Dist: coverage; extra == "dev"
Requires-Dist: cython>=3.0; extra == "dev"
Requires-Dist: kmdo; extra == "dev"
Requires-Dist: meson; extra == "dev"
Requires-Dist: meson-python; extra == "dev"
Requires-Dist: ninja; extra == "dev"
Requires-Dist: pudb; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: wheel; extra == "dev"
Provides-Extra: all
Requires-Dist: yace[dev]; extra == "all"
Dynamic: license-file

.. SPDX-FileCopyrightText: Simon A. F. Lund <os@safl.dk>
..
.. SPDX-License-Identifier: GPL-2.0-only

.. image:: docs/src/_static/yace-mascot.png
   :alt: yace

Welcome to yace
===============

.. image:: https://img.shields.io/pypi/v/yace.svg
   :target: https://pypi.org/project/yace
   :alt: PyPI

.. image:: https://github.com/safl/yace/actions/workflows/docs.yml/badge.svg
   :target: https://github.com/safl/yace/actions
   :alt: Build Status

.. image:: https://coveralls.io/repos/github/safl/yace/badge.svg?branch=main
   :target: https://coveralls.io/github/safl/yace?branch=main

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
   :target: https://github.com/safl/yace/blob/main/.pre-commit-config.yaml
   :alt: pre-commit

.. image:: https://api.reuse.software/badge/github.com/safl/yace
   :target: https://api.reuse.software/info/github.com/safl/yace
   :alt: REUSE status

**yace** generates the bindings of a C API for other languages. You describe the
FFI boundary of the API as a C header, in a subset of C99 that can be described
equivalently in C, C++, Python, Rust and Zig. From that header, **yace**
generates code that is idiomatic for each language. For C, **yace** generates a
C API with pretty-printers for every struct, union and enum. A field of bits, an
integer whose parts are named by masks, is printed part by part, and read and
written by part in every language. A header outside the subset is parsed too,
and **yace** reports every rule of the subset that the header breaks.

The project is hosted on `GitHub`_, and its documentation is at
`safl.dk/yace`_.

Bindings are generated for C, C++, Python (ctypes), Cython (a compiled module,
and a ``.pxd`` of the C API), Rust, Zig and Go. Each target builds and runs a
check of what it generated against the layout the C compiler gives every
record, and the C API and Zig check every function's signature against the
header too.

A header can also be written by a generator, from something other than C, and
taken as one written by hand: ``yace --generate file.py:Class``, or a
generator installed by name. A generator proposed to xNVMe writes the NVMe
specification headers of xNVMe in this way, from the data model that senfd
makes of the specification documents.

Contributions are welcome; the documentation says how the code is laid out.

.. _GitHub: https://github.com/safl/yace
.. _safl.dk/yace: https://safl.dk/yace

