Cythonize your project, securing it's source, while still be able to test with python and bundle with PyInstaller
Project description
Cython Compiler
A simple script that cythonizes your python project, handles import statements, so you still can use normal packaging tools like PyInstaller to bundle your project.
Installation
- pip install cython-compiler
or the manual way:
- git clone https://github.com/JessicaTegner/cython-compiler.git
- cd cython-compiler
- python setup.py install
Quick Usage (see below for a detailed tutorial)
usage: cython-compiler [-h] [-c] [-r] [-e ENTRY]
Cythonize your entire project while keeping the easyness of packaging with PyInstaller and testing with an interpreted language.
optional arguments:
optional arguments: -h, --help show this help message and exit -c, --cythonize Cythonize your project and assemble imports. -r, --remove Remove the .pyd files, so you can test with python. -e ENTRY, --entry ENTRY The entry file that starts the program when ran with python. This file will not be cythonized.
Detailed tutorial
- Install the Cython compiler.
- Go to the project you want to cythonize.
- If not done already, change the main file of your program, so i t contains a main method that starts the application.
- Make sure your entrypoint looks something like this.
import __required_imports__ # this will be generated by the cython cimpiler later.
import main_application # this is where your def main function is located, the method, that actually starts your application.
if __name__ == "__main__":
main_application.main() # asuming that your method is called main.
- run "cython-compiler -c -e program.py", where program.py is the entry of your application (look at the template above).
- After the cython compiler is done, test to see if it works with python program.py (if everything goes as planned, your program should start as normal).
License
GNU LESSER GENERAL PUBLIC LICENSE Version 3 For more information see the license file found in this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cython_compiler-1.0.2.tar.gz
.
File metadata
- Download URL: cython_compiler-1.0.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1ce98513604ab2cd73bd7310be61a70106b705954fdc1b60a08795b764b2f2d |
|
MD5 | 31f9733c7378775cb2b8041b9abef8aa |
|
BLAKE2b-256 | 330e806588b3efcbfe79e467179c6a5d646de6ce6cd98209b76dab0d0fd1ca70 |