A Flask-based service for building and distributing Python packages as frozen binaries and installers.
- Package Building: Build Python packages into wheels or standalone binaries
- Quick Install: Get installer scripts for any PyPI package
- Package Metadata: Retrieve detailed information about packages
- Build Management: Track and manage package builds
- RESTful API: Complete REST API for all operations
docker-compose up --buildpip install -r requirements.txt
python -m pybinsGET /- API documentation and available endpointsGET /health- Service health check
GET /<package>- Get installer script for latest versionGET /<package>@<version>- Get installer script for specific versionGET /meta/<package>- Get package metadata from PyPI
POST /enqueue- Enqueue a package buildPOST /build- Build a package immediatelyGET /builds- List all buildsGET /build/<build_id>- Get specific build status
GET /worker/builds- Worker-specific build listingPOST /worker/builds- Create new build via workerPOST /worker/run- Run immediate build via worker
GET /packages- List registered packagesPOST /packages- Register a new package
# Latest version
curl http://localhost:5000/requests
# Specific version
curl http://localhost:5000/requests@2.25.1curl http://localhost:5000/meta/flaskcurl -X POST http://localhost:5000/build
-H "Content-Type: application/json"
-d '{"package": "requests", "version": "latest", "build_type": "wheel"}'Invoke-WebRequest -Uri "http://localhost:5000/build" -Method POST -ContentType "application/json" -Body '{"package": "requests", "version": "latest", "build_type": "wheel"}'curl -X POST http://localhost:5000/build \
-H "Content-Type: application/json" \
-d '{"package": "requests", "version": "latest", "build_type": "binary"}'Invoke-WebRequest -Uri "http://localhost:5000/build" -Method POST -ContentType "application/json" -Body '{"package": "requests", "version": "latest", "build_type": "binary"}'Binaries built using the default Docker setup are Linux ELF executables, not Windows .exe files.
- If you download a binary (e.g.,
flask-binary.exe) and see unreadable characters orELFat the start when opening it, this means it is a Linux binary. - You cannot run Linux binaries directly on Windows. To run the binary on Windows, you must build it in a Windows environment (or use a Windows-based Docker image).
- Only packages that provide a command-line entry point (CLI tools, not libraries) can be built as binaries.
To build a Windows-compatible binary:
- Run the build process on a Windows machine (not in a Linux Docker container), or
- Use a Windows-based Docker image for building (advanced).
If you need help with this, see the documentation or open an issue.
After a successful build, the API response will include download URLs for the wheel, binary, or build log. You can download them using:
curl -O http://localhost:5000/download/<build_id>/<filename>Or in PowerShell:
Invoke-WebRequest -Uri "http://localhost:5000/download/<build_id>/<filename>" -OutFile <filename>The /enqueue endpoint now uses a background job queue (RQ/Redis) to process builds asynchronously. You must run an RQ worker for jobs to be processed.
curl -X POST http://localhost:5000/enqueue \
-H "Content-Type: application/json" \
-d '{"package": "flask", "version": "2.3.0"}'Invoke-WebRequest -Uri "http://localhost:5000/enqueue" -Method POST -ContentType "application/json" -Body '{"package": "flask", "version": "2.3.0"}'You must have Redis running (default: localhost:6379). Then, in a separate terminal:
rq worker builds --path pybinsThis will process enqueued build jobs in the background.
curl http://localhost:5000/build/<build_id>pybins/
├── __init__.py # Flask app factory
├── __main__.py # Entry point for python -m pybins
├── api/
│ └── server.py # API server blueprint
├── routes/
│ └── routes.py # Main application routes
├── worker/
│ ├── urls.py # Worker-specific routes
│ ├── tasks.py # Build tasks and job management
│ └── models.py # Data models
├── fetcher/
│ └── fetcher.py # PyPI/GitHub package fetching
├── storage/
│ ├── models.py # Storage data models
│ └── storage.py # In-memory storage management
└── queue/
└── setup.py # Task queue configuration
The service can be configured via environment variables:
FLASK_ENV: Set to 'development' or 'production'FLASK_DEBUG: Enable/disable debug modePORT: Port to run the service on (default: 5000)
- Add routes to
routes/routes.pyusing theroutes_bpblueprint - For worker-specific routes, use
worker/urls.pywithworker_bpblueprint - For API routes, use
api/server.pywithapi_blueprint
This project is open source. Feel free to use, modify, and distribute.