We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Translate Python .py, Cython .pyx, or a project ZIP into C/C++ source files.
Choose filesChoose or drop a file
.py · .pyx · .zip
Max 1 MB
Current single-file limit: 1 MB (guest 1 MB / member 2 MB / advanced 5 MB / professional 20 MB)
Cloud processing: files use short-lived OSS credentials and are processed in an isolated FC container. OSS cleanup follows the bucket lifecycle policy.
Supports .py, .pyx, or a ZIP containing project source files. Upload limits vary by account level, up to 20 MB.
This generates C/C++ source only. It does not build .so/.pyd modules. Generated code still needs matching Python headers, third-party dependencies, and a local C/C++ compiler.
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
Cython provides a source translator for Python code and typed Cython code. The input can be one .py file, one .pyx file, or a ZIP containing project sources; choose C or C++ output. A single file is useful for checking one module, while a project archive helps preserve package paths when several source modules need translation.
Translation is only the first stage of building an extension: after Cython writes C/C++ files, a matching Python development header set, project dependencies, system libraries, and a C/C++ compiler are needed to link a platform module such as .so or .pyd. This tool returns source files and a processing report. It does not compile the extension locally or guarantee a build for every platform.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
For one module, choose .py or .pyx. A project ZIP should keep package directories and source dependencies such as .pxd declarations or headers. Leave out virtual environments, caches, build folders, and unrelated large files.
Start with C for a conventional Python extension. Choose C++ when the source uses C++ features or must work with a C++ compiler. This changes the generated source type; it does not configure libraries or compiler flags.
The upload limit for your account appears on the page. When processing finishes, download the ZIP and inspect each generated .c/.cpp file and the report for skipped files, syntax errors, or dependency notes.
Install the matching Python headers, Cython dependencies, and toolchain on the target operating system. Compile and link using the project build configuration, then import the extension and run the relevant checks with the target Python version and platform.
Use cases
See how the tool fits into real work and everyday tasks.
A developer can generate C/C++ source and add it to an existing wheel build. The project maintainer still controls compiler flags, dependencies, and release platforms.
A maintainer can process several modules and use the report to identify missing declarations, package paths, or local source dependencies before preparing a reproducible build.
A lesson can use one small module to show how Python/Cython source becomes C/C++, then distinguish that source from the platform extension produced by a compiler.
Q&A
Find concise answers to common questions and confusing cases.
C source is not yet a Python extension. A compiler, headers matching the target Python, third-party dependencies, and link settings are still needed to produce a platform module such as .so or .pyd.
.py uses Python syntax and can provide Cython type declarations through pure-Python mode. .pyx also supports Cython-specific syntax such as cdef. Putting that extended syntax in a regular Python file causes a parse error.
Choose C++ when the module uses C++ syntax or interoperates with a C++ library. Selecting the output language does not install C++ dependencies or define include paths, link arguments, or the target ABI.
No. The archive provides project files for analysis and translation; the tool does not install arbitrary dependencies or create a release wheel. Include required declarations and prepare the actual build dependencies in your local environment.
Notes
Review scope, result limitations, and important precautions before use.
Generated C/C++ can be large and may contain source fragments; it is not a confidentiality format. Build results depend on Cython/Python versions, compiler behavior, system headers, directives, third-party libraries, and target platform. Binary extensions built for one platform generally cannot be moved unchanged to another.
Review ZIP contents and permissions before upload. Include only required source files and exclude credentials or production data. A report describes processing status; it does not prove that compilation succeeded or that the module behaves correctly. Complete linking, imports, and functional checks in the target build environment.
Related
Discover related tools, collections, and available API capabilities.