npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@narumitw/pi-python-lsp

v0.1.20

Published

Pi extension that exposes ty and Ruff language-server tools for Python.

Readme

🐍 pi-python-lsp — ty and Ruff Language Server Tools for Pi

npm Pi extension License: MIT

@narumitw/pi-python-lsp is a native Pi coding agent extension that exposes Python language-server tools from ty and Ruff.

Use it to give Pi reliable Python type diagnostics, Ruff lint diagnostics, formatting, import organization, and source fixes through Language Server Protocol (LSP) workflows.

✨ Features

  • Runs ty server on demand for Python type diagnostics.
  • Runs ruff server on demand for lint diagnostics.
  • Computes or writes Ruff formatting edits.
  • Computes or writes Ruff source actions such as source.fixAll.ruff and source.organizeImports.ruff.
  • Supports workspace roots, file limits, and recursive Python file discovery.
  • Starts language servers only for tool calls, then shuts them down.
  • Shows statusline activity only while Python LSP tools are running.
  • Provides clear setup errors when ty or Ruff is missing.

📦 Install

pi install npm:@narumitw/pi-python-lsp

Try without installing permanently:

pi -e npm:@narumitw/pi-python-lsp

Try this package locally from the repository root:

pi -e ./extensions/pi-python-lsp

✅ Requirements

Install ty and/or ruff somewhere on PATH, for example:

uv tool install ty
uv tool install ruff

Or provide custom server commands:

PI_TY_LSP_COMMAND="uvx ty server" PI_RUFF_LSP_COMMAND="uvx ruff server" pi -e ./extensions/pi-python-lsp

Optional timeout overrides:

PI_TY_LSP_TIMEOUT_MS=30000 PI_RUFF_LSP_TIMEOUT_MS=30000 pi -e ./extensions/pi-python-lsp

🛠️ Pi tools

  • ty_lsp_diagnostics — start ty server, open Python files, and return type diagnostics.
  • ruff_lsp_diagnostics — start ruff server, open Python files, and return lint diagnostics.
  • ruff_lsp_format — compute or write Ruff formatting edits for one Python file.
  • ruff_lsp_fix — compute or write Ruff source actions such as source.fixAll.ruff or source.organizeImports.ruff.

🚀 Examples

Check a Python project with ty or Ruff diagnostics:

{
  "paths": ["src", "tests"],
  "limit": 100
}

Format a Python file with Ruff:

{
  "path": "src/app.py",
  "write": true
}

Organize imports with Ruff:

{
  "path": "src/app.py",
  "kind": "source.organizeImports.ruff",
  "write": true
}

If paths is omitted for diagnostics, the tool recursively discovers Python files under the workspace root, skipping common cache and virtualenv directories.

💬 Command

/python-lsp

Shows the configured ty and Ruff LSP commands and whether each command is available on PATH.

🧠 Use cases

  • Let Pi typecheck Python code with ty before completing a task.
  • Ask Pi to run Ruff lint diagnostics while editing.
  • Format Python files through a native Pi tool.
  • Organize imports and apply safe Ruff fixes.
  • Add Python quality gates to AI coding agent workflows.

🗂️ Package layout

extensions/pi-python-lsp/
├── src/
│   └── python-lsp.ts
├── README.md
├── LICENSE
├── tsconfig.json
└── package.json

🔎 Keywords

Pi extension, Pi coding agent, Python LSP, ty, Ruff, Python type checking, Python linting, Python formatter, import organization, Language Server Protocol, AI coding tools.

📄 License

MIT. See LICENSE.