litgen: Generating binding code automatically #809
pthom
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
litgen is an automatic Python bindings generator designed for developers who appreciate clean, well-documented, and discoverable code and APIs.
It simplifies the process of creating Python bindings for C++ libraries using nanobind or pybind11, and generating bindings that are easy to use, properly documented, and fully integrated into Python IDEs.
litgen puts a strong emphasis on emitting documented and discoverable code, thus providing a great experience for the final python user.
It is based on srcML, a high-performance, multi-language parsing tool. The C++ API to be exposed to Python must be C++14 compatible, although the implementation can leverage more modern C++ features.
Here is an example when using bindings generated by litgen inside a python IDE:
Example of auto-completion in an IDE: all bindings are discoverable
Parameters type are accurately reproduced, and the function documentation is accessible
In the example above, the bindings were generated from the following C++ function signature:
And the generated code consists of two parts:
It comes with an extensive documentation, and supports a wide range of features
It can be installed locally (
pip install litgen
) or used online with no installIf you have some feedback, I'd be very happy to read it!
Beta Was this translation helpful? Give feedback.
All reactions