pkg.soopen package index

brew / rank 3378

Install py-spy with Homebrew, apk, Nix

Sampling profiler for Python programs. Version 0.4.2 via Homebrew; verified 2026-09-13. Also installable with nix: nix profile install nixpkgs#py-spy.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install py-spy

local Homebrew formula metadata

Linux

Alpine Linux apkverified · 92%
sudo apk add py-spy

Alpine Linux edge package indexes · py-spy · source: dl-cdn.alpinelinux.org

Nixverified · 92%
nix profile install nixpkgs#py-spy

nixpkgs package indexes · pkgs/by-name/py/py-spy/package.nix · source: api.github.com

overview

Package summary

Sampling profiler for Python programs

Commands and aliases

  • py-spy

history

Project history and usage

py-spy is a Rust-based sampling profiler that observes running Python programs with low overhead and without modifying their code.

Project history

Ben Frederickson created py-spy as a low-overhead sampling profiler inspired by rbspy. It reads CPython process memory externally, enabling profiling of an already-running program without restarting it or injecting profiling code.

Adoption history

py-spy is available as PyPI binary wheels, a Cargo package, a Homebrew formula, and packages for Alpine, Nix, and other ecosystems. Its prebuilt binaries and ability to attach to existing processes helped make production profiling accessible without application instrumentation.

How it is used

Its record command produces flame graphs, speedscope profiles, or raw samples; top provides a live view; and dump captures thread stacks. Attaching to unrelated processes may require elevated privileges or ptrace capabilities, especially in containers and Kubernetes.

Why package nerds care

py-spy is notable for combining Python-aware profiling with a Rust implementation that runs outside the target interpreter. It gives operators flame graphs and live top-like views while avoiding the code changes and in-process overhead associated with many traditional Python profilers.

Timeline

  • 2018: Early public py-spy releases established the external Python sampling-profiler workflow.
  • 2026: Version 0.4.2 added Python 3.14 support and further platform fixes.

Related projects

  • rbspy directly inspired py-spy's approach.
  • FlameGraph and speedscope are supported output and visualization ecosystems.
  • Traditional Python profilers provide related functionality but commonly execute inside the profiled process.

Sources

  • Official releases: https://github.com/benfred/py-spy/releases
  • Official repository README: https://github.com/benfred/py-spy#readme
  • source_facts.package-manager

security posture

Risk level: green

narrow executable package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • narrow executable package without higher-risk signals

Signals

  • metadata:no-higher-risk-signals

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 6 platform targets.
  • Build metadata lists 1 build dependencies.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
py-spycliglobal executable

freshness

Version and freshness

These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.

page generated2026-09-19
manager version0.4.2
manager updated2026-09-13
local dataok
upstreamcurrent
latest detectedv0.4.2

https://github.com/benfred/py-spy

  • okNo freshness warnings were generated.

install metadata

Package metadata

Package keybrew:py-spy
Version0.4.2
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/py-spy
Homepagehttps://github.com/benfred/py-spy
Repositoryhttps://github.com/benfred/py-spy
LicenseMIT
Source archivehttps://github.com/benfred/py-spy/archive/refs/tags/v0.4.2.tar.gz
Last updated2026-09-13T13:03:28Z
Pulseupdated
Build dependenciesrust
Bottleavailable (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namepy-spy
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Nix95%

py-spy

nix profile install nixpkgs#py-spy
  • normalized package name match
  • Matched by: Py Spy
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/py/py-spy/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
apk95%

py-spy 0.3.14-r3

Sampling profiler for Python programs

https://github.com/benfred/py-spy

sudo apk add py-spy
  • License: MIT
  • Architecture: x86_64
  • Source Package: py-spy
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Py Spy
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: py-spy from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

py-spy-bash-completion 0.3.14-r3

Bash completions for py-spy

https://github.com/benfred/py-spy

sudo apk add py-spy-bash-completion
  • License: MIT
  • Architecture: x86_64
  • Source Package: py-spy
  • normalized package name match
  • Matched by: Py Spy
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: py-spy-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

py-spy-doc 0.3.14-r3

Sampling profiler for Python programs (documentation)

https://github.com/benfred/py-spy

sudo apk add py-spy-doc
  • License: MIT
  • Architecture: x86_64
  • Source Package: py-spy
  • normalized package name match
  • Matched by: Py Spy
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: py-spy-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

py-spy-fish-completion 0.3.14-r3

Fish completions for py-spy

https://github.com/benfred/py-spy

sudo apk add py-spy-fish-completion
  • License: MIT
  • Architecture: x86_64
  • Source Package: py-spy
  • normalized package name match
  • Matched by: Py Spy
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: py-spy-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

py-spy-zsh-completion 0.3.14-r3

Zsh completions for py-spy

https://github.com/benfred/py-spy

sudo apk add py-spy-zsh-completion
  • License: MIT
  • Architecture: x86_64
  • Source Package: py-spy
  • normalized package name match
  • Matched by: Py Spy
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: py-spy-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment
  • pkg.so package database
  • pkgdb category and tag curation