Build Python wheels from pre-compiled binaries
Project description
bin2whl
Build Python wheels from pre-compiled binaries. Takes any pre-compiled binary (Go, Zig, C, Rust, etc.) and packages it as a platform-specific Python wheel for distribution on PyPI. One wheel per binary, per platform.
Features
- Zero dependencies (pure Python, standard library only)
- Config file support (
--config wheel.json) for repeatable builds - Single binary mode for one-off builds
- Platform aliases for cleaner config (e.g.
linux_arm64instead ofmanylinux_2_17_aarch64) - Binary lands directly in venv's bin/ — no Python wrapper
- Supports macOS, Linux, and Windows on x86_64 and ARM64
- Proper wheel metadata and SHA256 hashes (PEP 427)
- Optional PyPI classifiers
- Works with
pip installanduv tool install
Installation
# Using uv
uv pip install bin2whl
# Using pip
pip install bin2whl
Usage
Config file mode
Create a wheel.json:
{
"name": "your-go-tool",
"version": "0.1.0",
"description": "A Go CLI tool packaged for PyPI",
"author": "Your Name",
"author-email": "you@example.com",
"binaries": {
"linux_x86_64": "dist/tool-linux-x86_64",
"linux_arm64": "dist/tool-linux-arm64",
"macos_x86_64": "dist/tool-macos-x86_64",
"macos_arm64": "dist/tool-macos-arm64",
"windows_amd64": "dist/tool-win-x86_64.exe",
"windows_arm64": "dist/tool-win-arm64.exe"
}
}
Then build:
bin2whl --config wheel.json
Single binary mode
bin2whl \
--name your-go-tool \
--version-str 0.1.0 \
--binary dist/tool-linux-x86_64 \
--platform linux_x86_64
Output
Each binary produces one wheel:
wheels/
├── your_go_tool-0.1.0-py3-none-manylinux_2_17_x86_64.whl
├── your_go_tool-0.1.0-py3-none-manylinux_2_17_aarch64.whl
├── your_go_tool-0.1.0-py3-none-macosx_10_9_x86_64.whl
├── your_go_tool-0.1.0-py3-none-macosx_11_0_arm64.whl
├── your_go_tool-0.1.0-py3-none-win_amd64.whl
└── your_go_tool-0.1.0-py3-none-win_arm64.whl
Upload to PyPI, then users just run:
pip install your-go-tool
your-go-tool --help
Development
# Set up development environment
make dev
# Run linting and type checks
make check
# Format code
make format
# Build wheel and docs
make build
Publishing
Publishing requires cal-publish-python configuration.
# Build first
make build
# Publish wheel to PyPI and docs to GitLab Pages
make publish
Licence
Unlicense — public domain. See LICENSE.
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 Distributions
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 bin2whl-1.0.0b3-py3-none-any.whl.
File metadata
- Download URL: bin2whl-1.0.0b3-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9bf302854d5a4a160179ba825a0c2163aa98f88d6d7c69ceb84f49829a52e4a
|
|
| MD5 |
33531c701f0da5e5151cecf916fc0a4e
|
|
| BLAKE2b-256 |
6a58b3a7af01d8b8aa10777ebb978fb8f208c0cad4ca39f2454f103e0f13487a
|