Skip to main content

pi4py

pi4py packages a Python launcher for the @jamwil/pi-coding-agent npm CLI.

@jamwil/pi-coding-agent is a slow fork of @mariozechner/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 pi console script
  • nodejs-wheel-binaries as the bundled Node.js runtime
  • a build hook that installs the pinned @jamwil/pi-coding-agent npm package and packages the resulting npm runtime 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 npm dependencies, including @jamwil/pi-coding-agent itself, are installed during wheel build / pip install from sdist, not on first launch.

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 subprocesses
  • PI4PY_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
uv run python tools/update_pi_version.py --version 0.66.1-jamwil.0

Building

uv build

Building downloads the pinned @jamwil/pi-coding-agent npm package plus its production npm dependencies into src/pi4py/_vendor/npm_runtime, prunes the runtime, and includes it in the wheel.

Testing the bundled wheel

uv run pi may run the local editable/source checkout rather than the wheel artifact. To test the actual bundled runtime:

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

pi4py-0.79.7.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pi4py-0.79.7-py3-none-any.whl (14.2 MB view details)

Uploaded Python 3

File details

Details for the file pi4py-0.79.7.tar.gz.

File metadata

  • Download URL: pi4py-0.79.7.tar.gz
  • Upload date:
  • Size: 7.6 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

Hashes for pi4py-0.79.7.tar.gz
Algorithm Hash digest
SHA256 425a2c40c1fad0402756a09ad209e5a4370a2ea8365ab0714ee110b67b0db215
MD5 dfe24195caec265ed0cbcd2e421040ce
BLAKE2b-256 a3f23bf1488e88285d3d5e315ba59d3e76237eb6028a5fbba5fc73d2756212ce

See more details on using hashes here.

File details

Details for the file pi4py-0.79.7-py3-none-any.whl.

File metadata

  • Download URL: pi4py-0.79.7-py3-none-any.whl
  • Upload date:
  • Size: 14.2 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

Hashes for pi4py-0.79.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8b213d0a08cc1551a45216e3bfeb860447b6bafe0f5a07ae9b3968fb2f12f3dc
MD5 8372c681a221e4e66cd8ea4bc58fc82e
BLAKE2b-256 045c7e430b080d84f82bb3377fea2e89c99acaee07b4779b3e9c61f39e834010

See more details on using hashes here.

Release history Release notifications | RSS feed

0.84.4000

2 files

0.84.3.post3

2 files

0.84.3.post2

2 files

0.84.3.post1

2 files

0.84.3

2 files

This release

0.79.7 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page