What is the PXD file format?
.pxd is a developer file format originally associated with the Pyrex programming language and now the standard declaration format for Cython, its actively maintained successor. .pxd files store module declarations - type definitions, function signatures, and external C library interfaces - that can be shared across Cython modules. Much like a C header, a .pxd is added to the build so that other modules can access the declared types and functions. Cython stores implementation code in .pyx files.
Pyrex allowed developers to create Python extension modules using C-like syntax. Cython, forked from Pyrex in 2007, supports both C and Python syntax and remains the actively maintained project today. Both Pyrex and Cython syntax closely resembles that of Python rather than C, making adoption approachable for Python developers. Applications that mix modules written in C and Python are more efficient performance-wise, at the cost of some code complexity and additional compilation steps. A .pxd declaration file is brought into another Cython source using the cimport keyword - unlike standard Python modules, which use import.
Security & safety
RISK: LOWA .pxd is plain-text source code - not executable on its own and low risk to open in an editor. The usual source-code caution applies: building a project that includes untrusted .pyx/.pxd files runs the Cython compiler and a C compiler on that code, which can execute arbitrary build logic - only compile code you trust. Reading a .pxd is harmless.
Format details
in a nutshell- Pixadex icon library (Mac) - The discontinued Mac app Pixadex stored icon collections in .pxd files - unrelated to Cython.
- Pyxis / PixelView / ProxyDesigner data - Various niche tools (a Pyxis molecular viewer, ProxyDesigner) used .pxd for their own binary project/data files.
Programs that open PXD files
Technical details
deep spec| File type | Plain-text Cython declaration source file |
| MIME type | text/x-cython (also accepted as text/plain) |
| Character encoding | UTF-8 or ASCII; human-readable source text with no binary header |
| File signature | None - recognized by extension and Cython-specific keywords such as cdef, ctypedef, and cimport |
| Paired format | Typically paired with a same-named .pyx implementation file (e.g., mymodule.pxd alongside mymodule.pyx) |
| Import mechanism | Consumed by other Cython modules via the cimport keyword, not the standard Python import statement |
| Content restrictions | Declarations only: cdef types and functions, ctypedef, struct/union/enum, extern C/C++ blocks; no function implementations or executable statements permitted |
| Compilation role | Build-time only; not compiled to a separate binary - declarations are inlined into consuming .pyx files by the Cython compiler |
| C analogue | Functional equivalent of a C .h header file for Cython modules |
| Toolchain | Processed by the Cython compiler; integrates with setuptools, pip, scikit-build, and CMake build systems |
| Platform support | Cross-platform: Windows, macOS, Linux - any OS with a C compiler and CPython or PyPy |
| Typical file size | A few hundred bytes to tens of KB, depending on the number of declared symbols |
| Language versioning | Follows the Cython language version of the compiling toolchain (currently Cython 3.x) |
| Released | Pyrex (early 2000s); adopted and extended by Cython (forked 2007) |
| Latest version | Tracks the current Cython release (Cython 3.x) |
| Open standard | Yes · royalty-free |
| Specification | cython.readthedocs.io |
PXD conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about PXD files.