Python wrapper generator for ctypes
copied from cf-staging / ctypesgenctypesgen is a pure-python ctypes wrapper generator. It parses C header files and creates a wrapper for libraries based on what it finds.
Preprocessor macros are handled in a manner consistent with typical C code. Preprocessor macro functions are translated into Python functions that are then made available to the user of the newly-generated Python wrapper library.
It can also output JSON, which can be used with Mork, which generates bindings for Lua, using the alien module (which binds libffi to Lua).