
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
A python build helper library to compile (obfuscate) and pack Python files using Cython and PyInstaller
A python build helper library to compile (obfuscate) and pack Python files using Cython and PyInstaller.
This Python module, build_helper.py
, provides a set of functions to simplify the process of compiling Python code using Cython and packaging it into a single package using PyInstaller. It allows you to manage the compilation and packaging process with ease, including handling data files, excluding specific files or directories, and specifying hidden imports.
You can install using pip
:
pip install pybulidhelper
or you can install from source:
python setup.py install
To compile all Python files in a directory using Cython, you can use the compile
function:
from build_helper import compile
compile(
main_file="main.py",
data_files=["data", "**/*.json"],
exclude_files=["test"],
source_dir=".",
intermediate_dir="build",
dist_dir="dist"
)
To package the compiled files into a single package using PyInstaller, you can use the pack
function:
from build_helper import pack
pack(
main_file="main.py",
data_files=["data", "**/*.json"],
exclude_files=["test"],
hidden_imports=["numpy"],
executable_name="my_app",
onefile=True,
source_dir=".",
intermediate_dir="build",
dist_dir="dist"
)
hidden_imports
is an optional parameter that allows you to specify additional modules to be included in the package. Maybe you have arequirements.txt
file, instead of specifying each module manually, you can usehidden_imports_from_requirements="requirements.txt"
to specify the modules in therequirements.txt
file.
onefile
is set toFalse
by default, but you can set it toTrue
to create a single executable file.
To perform both compilation and packaging in one step, you can use the compile_and_pack
function:
from build_helper import compile_and_pack
compile_and_pack(
main_file="main.py",
data_files=["data", "**/*.json"],
exclude_files=["test"],
hidden_imports=["numpy"],
executable_name="my_app",
onefile=True,
source_dir=".",
compile_intermediate_dir="build/compile",
compile_dist_dir="build/compile_dist",
pack_intermediate_dir="build/pack",
pack_dist_dir="dist"
)
This project is licensed under the MIT License.
FAQs
A python build helper library to compile (obfuscate) and pack Python files using Cython and PyInstaller
We found that pybuildhelper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.