Skip to main content

A tool for converting one or more C/C++ headers to Cython pxd files.

Project description

PxdGen

PxdGen is a tool which uses Clang to convert C/C++ header files to Cython pxd files. It has two modes of operation: single-file mode and directory mode. Single file mode is well suited for C/C++ libraries that consolodate all definitions into a single header, while directory mode is better suited for large projects with many independent headers. There are some examples which use PxdGen on C/C++ libraries in the tests folder.

Installation

pip install pxdgen

Requirements

  • Clang - The version of libclang.(dll/so/dylib) on your system should match the version of the Python bindings to Clang. If it is not found by the standard library search path on your system, PxdGen allows you to point it to the library with -L.

Bugs/Limitations

  • Experimental C++ support

Usage

pxdgen [-h] [-o OUTPUT] [-p RELPATH] [-r] [-x LANGUAGE] [-I INCLUDE] [-L LIBS] [-v] [-f FLAGS] header

A tool that converts C/C++ headers to pxd files

positional arguments:
  header                Path to C/C++ header file or project directory to parse

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Path to output file or directory (defaults to stdout)
  -p RELPATH, --relpath RELPATH
                        Relative path to parse from (defaults to pwd)
  -r, --recursive       Include declarations from all nested headers
  -x LANGUAGE, --language LANGUAGE
                        Force Clang to use the specified language for interpretation
  -I INCLUDE, --include INCLUDE
                        Add a directory to Clang's include path
  -L LIBS, --libclang-path LIBS
                        Specify the path to a directory containing libclang and its dependencies
  -v, --verbose         Print the status of the application to stdout
  -f FLAGS, --flag FLAGS
                        Set a flag to further tune the program output

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

pxdgen-1.1.1.tar.gz (31.4 kB view hashes)

Uploaded Source

Built Distribution

pxdgen-1.1.1-py3-none-any.whl (35.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page