Distributing Go binaries like sqlite-scanner through PyPI using go-to-wheel

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Python developers can now ship and consume Go binaries as ordinary PyPI dependencies, so pip install or uvx delivers a precompiled cross-platform CLI without users knowing Go is involved.

Read this as

Simon Willison built a small Go program called sqlite-scanner that searches folders for SQLite database files. The new part is how he shares it: he uploads compiled copies of it to PyPI, the online store where Python programmers download software. That means anyone can run it by typing 'uvx sqlite-scanner', with the correct version fetched automatically for their computer, and other Python tools can use it too.

Willison released sqlite-scanner, a Go tool that scans directories for SQLite files, on PyPI so users install it with a single 'uvx' or 'pip' command instead of downloading and compiling binaries themselves. The companion go-to-wheel tool automates this packaging, and a Datasette plugin demonstrates consuming Go binaries as Python dependencies. For teams shipping CLI tools, this removes distribution friction; no costs or licensing details are given.

go-to-wheel compiles a Go project into eight platform-specific wheels (macOS x86_64/arm64, manylinux and musllinux x86_64/aarch64, win_amd64/win_arm64) that bundle the binary plus an __init__.py wrapper. The wrapper exposes get_binary_path(), chmods the binary executable on Unix, and execs it via os.execvp (subprocess.call on Windows) through a console entry point. sqlite-scanner detects SQLite files by matching the 16-byte magic header and supports --json, --jsonl and --size flags; wheels upload via twine.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

sqlite-scanner go-to-wheel PyPI Datasette uv wazero Claude

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading