Skip to main content

Automatically generate Cython pxd files from C headers

Project description


A friendly fork of autopxd

It generates .pxd files automatically from .h files.

Tested against:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • PEP8

Test Lint


pip install autopxd2


Usage: autopxd [OPTIONS] [INFILE] [OUTFILE]

  Generate a Cython pxd file from a C header file.

  -v, --version                   Print program version and exit.
  -I, --include-dir <dir>         Allow the C preprocessor to search for files
                                  in <dir>.

  -D, --compiler-directive <directive>
                                  Additional directives for the C compiler.
  --debug / --no-debug            Dump preprocessor output to stderr.
  -h, --help                      Show this message and exit.

release history:

v2.0.4 - 2021-11-23

  • fix: Windows CRLF issue (#24)

v2.0.3 - 2021-10-08

  • fix: remove unnecessary importlib_resources from install_requires

v2.0.2 - 2021-10-07

v2.0.1 - 2021-10-06

  • Add --compiler-directive option to pass along to the compiler
  • Add some type annotations (
  • Drop support for Python 2
  • Add linting, format with black
  • Migrate from Travis CI to Github Actions

v1.1.0 - 2020-01-03

  • Support for OSX


  • Refactoring of the code DONE
  • Adding tests for PEP8 DONE
  • Uploading to PyPi DONE
  • Check that the generated code is correct by comparing it to the libc in Cython
  • More tests
  • Merge it into Cython so that the .pxd files aren't necessary anymore? Maybe.

Please raise an issue if the generated code isn't correct.

It's difficult to catch all the corner cases.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for autopxd2, version 2.0.4
Filename, size File type Python version Upload date Hashes
Filename, size autopxd2-2.0.4.tar.gz (53.3 kB) File type Source Python version None Upload date Hashes View
Filename, size autopxd2-2.0.4-py3-none-any.whl (267.0 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page