Lightweight Python Pre Compiler and Packager (As a single Package), with Added Support for Dependencies having C/C++ extensions. e.g. Numpy
A Picture is Worth a Thousand Words
If you're tired of the below aspects of your Python Deployments, PyCompilePackage is the right Tool for you;
* You Don't want to share the Original Python Source Code, so that there is no or little chance for tampering your source
* You want your Python Depolyments clean, and would like to package all your source in a single package
PyCompilePackge, Helps to make your Python Build/Deployments clean and compact by;
This has the below advantages over the traditional python deployments;
* Chances for Individual file corruption post deployment is less, Since all files have packaged as a single PYZ file
Refer DemoStandaloneApp
In a nutshell, for every new Python Project you have to do the below;
1. Unzip the latest PyCompilePackage Release to your Source folder (Under BUILD Directory)
5. Copy "\DIST\OUTPUT" folder contents to your Target/Deployment directory/machines and use "RunApp.BAT or sh" to run the package
Compiling Source Code: By Default Source Python Files will be copied to the package without any pre-compilation. This will enable the target package to be run under different versions of python, without any re-packaging. However If you would like to copy the pre-compiled (pyc files) version, instead of the original source files (py files), say to hide the source code from the users, use the below Setting
"NO_COMPILE" : "NO"
Embedding External Dependencies: If you include requirements.txt file as an Internal Resource, The Builder will copy all mentioned dependencies in the 'requirements.txt' file to the final standalone APP file. Though this build process may take a while, the Standalone App is now selfcontained, and does not require the dependencies available on the target machines !
e.g.
"INTERNAL_RESOURCES": [
["BUILD/requirements.txt",""],
The below settings will control the pre-compilation of external dependencies.
"PRE_COMPILE_REQUIREMENTS" : "NO",
"NO" will copy the external packages as is to the final APP file. "YES" will compile the external packages before copying to the final APP file.
"EXTRACT_REQUIREMENTS" : "NO",
This setting is specific for Libraries having C/C++ extensions such as Numpy. Such Libraries needs to be extracted on target machines before running the APP. (They wont run properly from the ZipApp package)
A "NO" will not extract the external packages to the target machines, instead it will try to load from the APP file itself.
"YES" will first extract the external packages before loading the dependencies. Required for external libraries having C/C++ extensions.
PyCompilePackage itself built using the same PyCompilePackage Build methodology.
Use command "\BUILD\BuildPackage.BAT or sh", and find the Built Package (PyCompilePackager.pyz) in "DIST/OUTPUT" folder.
Or you could directly run Main.py, from VSCode to achieve the same result.
Copy the Contents of the above "DIST/OUTPUT" folder, to "BUILD" folders of target python projects (for PyCompilePackage, these are its Deployment Folders), Which you want to package using PyCompilePackage Build methodology.