Skip to main content

uncythonize

This script strips cython code (.pyx files) down to python code, by replacing cython declarations (cdef) with python equivalents and stripping away type annotations.

Limitations

This is a simple script working based on text substitutions. It does not handle, or even claim to handle, all valid cython syntax.

Python 3.5 and above is required.

UTF-8 input is required.

Installation

$ pip install uncythonize

Usage

$ uncythonize.py filename.pyx

will produce a corresponding file filename.pyx.py

That file can then be run through various syntax checkers and linters, such as pyflakes, pydocstyle, pylint, vulture, pystrict3.

It is useful to substitute in output of these tools back the original filename, filename.pyx.py -> filename.pyx

Line numbering is preserved by this tool.

More than one file can be processed.

Contributing

Contributions are welcome! Please open pull requests.

If you adapt the script to handle your use case, please add example scripts as test cases.

TODO

  • setup CI testing

Licence

This code was originally developed at https://github.com/guyskk/validr by guyskk, and is redistributed here under the GPL-3 licence.

Some modifications were made by JohannesBuchner to support testing the UltraNest repository.

Release Notes

0.1.0 (2020-03-07)

  • First version

Metadata

Release files for uncythonize 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uncythonize 0.1.1
File Size Uploaded Provenance Actions
uncythonize-0.1.1.tar.gz 20.6 kB Without provenance Details for uncythonize-0.1.1.tar.gz

Release files / uncythonize-0.1.1.tar.gz

Download URL uncythonize-0.1.1.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
430a15ac95e23c58f856651f6d066797ffe598e452b0817c6c729283775e97a1
BLAKE2b-256 checksum
How to use checksums
5698442e15afd335c4e7c9d55c23851dbb89da1d20f3da2a6a7db1e45354a153
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.10

Security for uncythonize 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page