Bundle a Python project into a self-contained native binary
Project description
python2binary 🚀
python2binary adalah alat baris perintah (CLI) untuk membungkus proyek Python Anda menjadi sebuah file binary native yang mandiri (self-contained).
Cara Kerja (Pipeline)
Program ini bekerja melalui tiga tahap utama:
- Pack: Membungkus semua file
.pydalam proyek Anda menjadi arsip.pyz(zipapp). - Convert: Mengubah file
.pyzmenjadi header C (.h) menggunakanxxd. - Compile: Menghasilkan launcher C yang menyematkan data Python tersebut dan mengkompilasinya menggunakan
gccmenjadi binary native.
Binary yang dihasilkan akan mengekstrak kode Python ke folder sementara saat dijalankan dan mengeksekusinya menggunakan interpreter python3 yang ada di sistem target.
Prasyarat Sistem
Sebelum menggunakan python2binary, pastikan sistem Anda telah memiliki:
- Python 3.8+
- GCC: Compiler C (untuk tahap kompilasi).
- XXD: Tool hexdump (untuk tahap konversi).
Di Ubuntu/Debian, Anda dapat menginstalnya dengan:
sudo apt-get update
sudo apt-get install build-essential xxd
Instalasi
Gunakan mode editable agar Anda dapat menjalankan perintah python2binary secara global di dalam venv Anda:
# Aktifkan venv Anda
source .binary/bin/activate
# Instal proyek
pip install -e .
Penggunaan
Setelah diinstal, Anda dapat menjalankan python2binary langsung dari terminal:
python2binary --project <direktori_proyek> --entry <file_utama> --output <folder_hasil> [--name <nama_binary>]
Parameter:
--project,-p: Direktori root proyek Python Anda.--entry,-e: Script entry-point (misal:main.pyatauapp/run.py), relatif terhadap direktori proyek.--output,-o: Direktori tujuan hasil build.--name,-n(Opsional): Nama file binary yang dihasilkan. Default menggunakan nama folder proyek.
Contoh:
python2binary -p ./my_script_folder -e main.py -o ./dist -n my_application
Struktur Proyek
main.py: Entry point CLI.pipeline.py: Logika utama orkestrasi pembangunan binary.infrastructure/: Implementasi teknis untuk packing, konversi, dan kompilasi.interfaces/: Definisi abstraksi untuk setiap tahapan pipeline.schemas/: Struktur data untuk konfigurasi dan hasil build.
Lisensi
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python2binary-0.1.0.tar.gz.
File metadata
- Download URL: python2binary-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d667ac181d6c968bb2558e398d6f24ac42ca34d8fc089bbbcf43341d8e17ab0d
|
|
| MD5 |
7ce6c461376449434de7874b19b708c8
|
|
| BLAKE2b-256 |
89d5f701529703d125a971ba38c24c136b0d34a42766f202acd0099ff46e4951
|
Provenance
The following attestation bundles were made for python2binary-0.1.0.tar.gz:
Publisher:
publish.yml on FauzanAriyatmoko/python2binary
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python2binary-0.1.0.tar.gz -
Subject digest:
d667ac181d6c968bb2558e398d6f24ac42ca34d8fc089bbbcf43341d8e17ab0d - Sigstore transparency entry: 1427447316
- Sigstore integration time:
-
Permalink:
FauzanAriyatmoko/python2binary@f598a88b2ff2040a4c3e22ca92286f572b3ccdc5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/FauzanAriyatmoko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f598a88b2ff2040a4c3e22ca92286f572b3ccdc5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file python2binary-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python2binary-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cc4f6a337732c03bb034e7cc8a3a87cef247489d82733fba424ccee4fa5b7e7
|
|
| MD5 |
12ea3477cd25762d326bd73209061ce1
|
|
| BLAKE2b-256 |
7a1959d1736c2bd3d918c3d5989eaed403a0215262bd9a798a5516394eb0bc4d
|
Provenance
The following attestation bundles were made for python2binary-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on FauzanAriyatmoko/python2binary
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python2binary-0.1.0-py3-none-any.whl -
Subject digest:
2cc4f6a337732c03bb034e7cc8a3a87cef247489d82733fba424ccee4fa5b7e7 - Sigstore transparency entry: 1427447608
- Sigstore integration time:
-
Permalink:
FauzanAriyatmoko/python2binary@f598a88b2ff2040a4c3e22ca92286f572b3ccdc5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/FauzanAriyatmoko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f598a88b2ff2040a4c3e22ca92286f572b3ccdc5 -
Trigger Event:
push
-
Statement type: