macOS
brew install py-spylocal Homebrew formula metadata
brew / rank 3378
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
brew install py-spylocal Homebrew formula metadata
sudo apk add py-spyAlpine Linux edge package indexes · py-spy · source: dl-cdn.alpinelinux.org
nix profile install nixpkgs#py-spynixpkgs package indexes · pkgs/by-name/py/py-spy/package.nix · source: api.github.com
overview
Sampling profiler for Python programs
history
py-spy is a Rust-based sampling profiler that observes running Python programs with low overhead and without modifying their code.
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.
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.
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.
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.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
py-spy | cli | global executable |
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.
https://github.com/benfred/py-spy
install metadata
| Package key | brew:py-spy |
|---|---|
| Version | 0.4.2 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/py-spy |
| Homepage | https://github.com/benfred/py-spy |
| Repository | https://github.com/benfred/py-spy |
| License | MIT |
| Source archive | https://github.com/benfred/py-spy/archive/refs/tags/v0.4.2.tar.gz |
| Last updated | 2026-09-13T13:03:28Z |
| Pulse | updated |
| Build dependencies | rust |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | py-spy |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
py-spy
nix profile install nixpkgs#py-spypy-spy 0.3.14-r3
Sampling profiler for Python programs
https://github.com/benfred/py-spy
sudo apk add py-spypy-spy-bash-completion 0.3.14-r3
Bash completions for py-spy
https://github.com/benfred/py-spy
sudo apk add py-spy-bash-completionpy-spy-doc 0.3.14-r3
Sampling profiler for Python programs (documentation)
https://github.com/benfred/py-spy
sudo apk add py-spy-docpy-spy-fish-completion 0.3.14-r3
Fish completions for py-spy
https://github.com/benfred/py-spy
sudo apk add py-spy-fish-completionpy-spy-zsh-completion 0.3.14-r3
Zsh completions for py-spy
https://github.com/benfred/py-spy
sudo apk add py-spy-zsh-completionsource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.