Skip to main content

🗂️ py2cy

py2cy is a library designed to convert Python source code into Cython format, enabling the transformation of .py files into .so files on Linux and .pyd files on Windows. Additionally, it aids in obfuscating the code, making reverse engineering more challenging.

🏃 Quickstart

Installing the package

pip install py2cy

Arrange the configuration file setup.cfg for your projects

######CYTHON CONFIGURATIONS######
#threads for cythonize in linux
[NThreads]
nThreads=4

#path of the folder to be obfuscated
[SourcePath]
pkg_for_obfuscation=<<path of the project to be obfuscated>>

#files to be excluded from cythonization, comma separated values, must have file extension
[FilesToExclude]
files_to_exclude=abc.py,bde.py

#comma separated values
[PkgsToExclude]
pkgs_to_exclude=package1,package2

#If this is set, both exclude conditions metioned above will be ignored,#comma separated values
[FilesToInclude]
files_to_include=test1.py,test2.py

#If this is set, both exclude conditions above will be ignored,#comma separated values
[PkgsToInclude]
pkgs_to_include=
###############################

▶️ Execute

After the above configuration invoke py2cy in the command line interface as below

py2cy <<path of the setup.cfg>>

or

py2cy #invoke from the current working directory where setup.cfg is present

Once the execution gets completed, a package with same name suffixed with _cython gets generated next to the actual source code.

Based on the configuration set in setup.cfg, respective files are cythonized.

Metadata

Release files for py2cy 0.0.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 py2cy 0.0.1
File Size Uploaded Provenance Actions
py2cy-0.0.1.tar.gz 5.5 kB Without provenance Details for py2cy-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py2cy 0.0.1
File Interpreter ABI Platform Actions
py2cy-0.0.1-py3-none-any.whl Python 3 none any Details for py2cy-0.0.1-py3-none-any.whl

Total release size: 11.6 kB

Release files / py2cy-0.0.1.tar.gz

Download URL py2cy-0.0.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a1c221d77302b6a1108505d9fd95e76a0160812888d57bc25ca4f74934743fce
BLAKE2b-256 checksum
How to use checksums
8e47975953e2272b84157ab21e3b1288836ebabac8a956827e90a796d014fba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Release files / py2cy-0.0.1-py3-none-any.whl

Download URL py2cy-0.0.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88dc5b8020b18d88e4afb17c144271484953da90911b9422ba551f481bee1ef3
BLAKE2b-256 checksum
How to use checksums
24f5d2c34c663070373fa73c1d759f0b7d9da273cae8f1a3fe83fc46bf6ec782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.4

Security for py2cy 0.0.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.0.1 This release

2 release files 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