pi4py
pi4py packages a Python launcher for the @jamwil/pi-coding-agent npm CLI.
@jamwil/pi-coding-agent is a slow fork of @earendil-works/pi-coding-agent.
The primary use for this is to expose a self-contained pi executable that can
be used from python using rpc mode.
What it installs
- a
piconsole script nodejs-wheel-binariesas the bundled Node.js runtime- a build hook that downloads the pinned
@jamwil/pi-coding-agentnpm package and packages its standalone JavaScript bundle into the Python wheel
Usage
Install the wheel and invoke the console script with pi from the command line
or from Python with subprocess.Popen:
import subprocess
process = subprocess.Popen(["pi", "--help"])
process.wait()
The pi entry point launches the bundled @jamwil/pi-coding-agent CLI with the
bundled Node.js executable. The standalone @jamwil/pi-coding-agent bundle is
downloaded during wheel build / pip install from sdist.
It also routes npm, npx, node, and corepack lookups to bundled shims and
isolates npm global installs under PI_CODING_AGENT_DIR/npm-global by default.
Useful environment variables:
PI4PY_NPM_PREFIX: override the npm global prefix used by launched pi subprocessesPI4PY_SKIP_NPM_BUILD: skip the npm build hook for metadata/debug builds only; the resulting package will not run unless a runtime is already present
Updating the pinned pi version
Sync dependencies, then update the pinned npm version:
uv sync --all-extras
uv run python tools/update_pi_version.py --version 0.84.3-dev.1
Building
uv build
Building downloads the pinned @jamwil/pi-coding-agent npm tarball, extracts
its dist/standalone bundle into src/pi4py/_vendor/npm_runtime, and includes
that small runtime in the wheel.
Testing the bundled wheel
uv run --no-editable pi --help
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 pi4py-0.84.3.post1.tar.gz.
File metadata
- Download URL: pi4py-0.84.3.post1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02ca6a96dbf6d1211e218952de16e76b7f2af0fd34eaa81b744b27f9e5135657
|
|
| MD5 |
138d52fe423a9c5e49fe069031190a9f
|
|
| BLAKE2b-256 |
0982475068ebacb9bff065c5858f000fcabbc66696e15677979942b44b792ace
|
File details
Details for the file pi4py-0.84.3.post1-py3-none-any.whl.
File metadata
- Download URL: pi4py-0.84.3.post1-py3-none-any.whl
- Upload date:
- Size: 2.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48cf11efa9d9f77a96ebbef13a9edb4ee9363ea27aebec7bc8c4b438744e432c
|
|
| MD5 |
196b5b8ef0d095de84f5dab53f04febc
|
|
| BLAKE2b-256 |
a66c69c866ceaea42765f1850ceb33eb2adadc82f9ea8f53cc16ac84ad92986c
|