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 @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 pi console script
  • nodejs-wheel-binaries as the bundled Node.js runtime
  • a build hook that downloads the pinned @jamwil/pi-coding-agent npm 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()

To get the absolute path to the Node.js binary installed by nodejs-wheel-binaries in the active virtual environment:

from pi4py import get_node_binary

node = get_node_binary()

You can also print the path directly from the command line:

pi-node-path

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 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 --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 --version

Metadata

Release files for pi4py 0.87.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pi4py 0.87.0
File Size Uploaded Provenance Actions
pi4py-0.87.0.tar.gz 8.3 kB Without provenance Details for pi4py-0.87.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pi4py 0.87.0
File Interpreter ABI Platform Actions
pi4py-0.87.0-py3-none-any.whl Python 3 none any Details for pi4py-0.87.0-py3-none-any.whl

Total release size: 3.5 MB

Release files / pi4py-0.87.0.tar.gz

Download URL pi4py-0.87.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8e30dd1f897346d88a2f6e3310ff5a46e2cfd7003ae3c9d795ffa610ecc3c36a
BLAKE2b-256 checksum
How to use checksums
3609d41da16ad12f885d2a26f9930aab3e1d7ea6233a89bf1d523dbfaf7fe270
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / pi4py-0.87.0-py3-none-any.whl

Download URL pi4py-0.87.0-py3-none-any.whl
Size 3.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
45379676d3d99cc8e69fe66b8db83569e0abac25091eb771bf66df128ad08940
BLAKE2b-256 checksum
How to use checksums
d68023dc0c4e803d625e4260d909ecdea6b40a73b29c46721afc8ccdc048f9b2
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for pi4py 0.87.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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