CYTHON(1)
β¨ CYTHON(1) β¨
okay bestie, sit DOWN, because this is the manual page for cython from User Commands and it's literally the moment your .pyx files get their glow-up π
πΈ NAME πΈ
cython β compile Cython code (.pyx) into C so you can build a Python extension πβ‘οΈπ¨
π¦ DESCRIPTION π¦
okay so, here's the vibe. The usage line goes like this, exactly:
cython [-h] [-V] [-l] [-I INCLUDE_PATH] [-o OUTPUT_FILE] [-t]
[-f] [-v]
[-p] [--cleanup GENERATE_CLEANUP_CODE] [--cache] [-w
WORKING_PATH] [--gdb] [--gdb-outdir GDB_OUTDIR] [-D] [-a]
[--annotate-fullc] [--annotate-coverage ANNOTATE_COVERAGE_XML]
[--line-directives] [-+] [--embed] [-2] [-3] [--3str] [--lenient]
[--capi-reexport-cincludes] [--fast-fail] [-Werror] [-Wextra] [-X
NAME=VALUE,...] [-E NAME=VALUE,...] [--module-name MODULE_NAME]
[-M] [--generate-shared SHARED_C_FILE_PATH] [--shared
SHARED_UTILITY_QUALIFIED_NAME] [sources ...]
So what even IS this? Cython (https://cython.org/) is a compiler for code written in the Cython language. That's the whole thing. And plot twist: Cython is based on Pyrex by Greg Ewing π«Ά (shoutout to the ancestors, no cap).
π positional arguments:
sourcesβ the files you're feeding in, bestie. That's it, that's the list.
π options:
-h,--helpβ shows this help message and dips. classic.-V,--versionβ Display version number of cython compiler β¨-l,--create-listingβ Write error messages to a listing file π (so you can read your mistakes in style)-I,--include-dir INCLUDE_PATHβ Search for include files in named directory. and yes, you can stack them β multiple include directories are allowed π-o,--output-file OUTPUT_FILEβ Specify name of generated C file-t,--timestampsβ Only compile newer source files (lazy-girl efficiency, we love her)-f,--forceβ Compile all source files, and it overrides implied-tπ no skipping allowed-v,--verboseβ Be verbose, print file names on multiple compilation π£οΈ-p,--embed-positionsβ If specified, the positions in Cython files of each function definition is embedded in its docstring.--cleanup GENERATE_CLEANUP_CODEβ Release interned objects on python exit, for memory debugging. Level indicates aggressiveness, default 0 releases nothing.--cacheβ Enables Cython compilation cache. β‘ (she remembers things so you don't have to)-w,--working WORKING_PATHβ Sets the working directory for Cython (the directory modules are searched from)--gdbβ Output debug information for cygdb π--gdb-outdir GDB_OUTDIRβ Specify gdb debug information output directory. Implies--gdb. (sneaky little chain reaction, iykyk)-D,--no-docstringsβ Strip docstrings from the compiled module. bye bye little comments π-a,--annotateβ Produce a colorized HTML version of the source. π pretty AND useful--annotate-fullcβ Produce a colorized HTML version of the source which includes entire generated C/C++-code.--annotate-coverage ANNOTATE_COVERAGE_XMLβ Annotate and include coverage information from cov.xml.--line-directivesβ Produce#linedirectives pointing to the.pyxsource-+,--cplusβ Output a C++ rather than C file. β¨C++ girlies riseβ¨--embedβ Generate amain()function that embeds the Python interpreter. Pass--embed=<method_name>for a name other thanmain().-2β Compile based on Python-2 syntax and code semantics.-3β Compile based on Python-3 syntax and code semantics.--3strβ Compile based on Python-3 syntax and code semantics (same as-3since Cython 3.1).--lenientβ Change some compile time errors to runtime errors to improve Python compatibility π«Ά (she's being nice to you)--capi-reexport-cincludesβ Add cincluded headers to any auto-generated header files.--fast-failβ Abort the compilation on the first error. no second chances, periodt π-Werror,--warning-errorsβ Make all warnings into errors. every warning is now a jumpscare π-Wextra,--warning-extraβ Enable extra warnings.-X,--directive NAME=VALUE,...β Overrides a compiler directive-E,--compile-time-env NAME=VALUE,...β Provides compile time env likeDEFwould do.--module-name MODULE_NAMEβ Fully qualified module name. If not given, is deduced from the import path if source file is in a package, or equals the filename otherwise.-M,--depfileβ produce depfiles for the sources--generate-shared SHARED_C_FILE_PATHβ Generates shared module with specified name.--shared SHARED_UTILITY_QUALIFIED_NAMEβ Imports utility code from shared module specified by fully qualified module name.
π§ Environment variables:
CYTHON_CACHE_DIRβ the base directory containing Cython's caches. π that's the one, bestie, that's the whole list.
real talk for one sec: this page is from Cython 3.1.6, dated March 2026, and it's filed under CYTHON(1) in the User Commands section. go forth and compile, my love ππ¦β¨
π¦ where this page comes from
- ubuntu resolute: cython3 3.1.6+dfsg-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: cython3 3.1.6+dfsg-1ubuntu2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms