Pyrasite

Open source

Set of tools for injecting arbitrary code into running Python processes using gdb, for debugging and monitoring.

pyrasite.com
Pyrasite homepage screenshot
GitHub stars
2.9k
Last 30 days
+0
Last commit
1 yr ago
Repository age
15 years
Licence
GPL-3.0
Self-hosted
Yes

About Pyrasite

Pyrasite is a Python package that injects code into a Python process that is already running. That lets you inspect or change a live program without restarting it, which is why the repository tags it for debugging and monitoring.

It relies on gdb, version 7.3 or newer, to attach to the target. On OS X the README adds that gdb has to be codesigned and links to instructions for building it on Darwin if you see codesigning errors when running with --verbose.

The tool works with Python 2.4 and newer. Injection also works across versions, so Pyrasite can run under Python 3 and inject into a Python 2 process, or the other way round.

A graphical interface exists as a separate project called pyrasite-gui. The package is on PyPI, documentation is hosted on Read the Docs, and the code is licensed under the GNU GPL v3.

Key features

  • Injects arbitrary code into running Python processes
  • Uses gdb to attach to the target process
  • Supports Python 2.4 and newer
  • Injects across Python versions in both directions
  • Separate graphical interface called pyrasite-gui
  • Distributed as a PyPI package with online documentation

Good fit for

  • Debugging a live Python process
  • Monitoring a running Python program
  • Injecting across Python 2 and 3
Built with
Python tools
Tags
python
debugging
gdb
monitoring
code-injection
developer-tools

Pyrasite: questions and answers

What is Pyrasite used for?
Pyrasite is a set of tools for injecting arbitrary code into running Python processes using gdb, for debugging and monitoring. It is a good fit for debugging a live Python process, monitoring a running Python program, and injecting across Python 2 and 3.
Is Pyrasite open source?
Yes. Pyrasite is open source under the GPL-3.0 licence. Its source code is on GitHub at lmacken/pyrasite and is written mainly in Python.
Is Pyrasite free?
Yes. Pyrasite is open source, so the software itself is free to use.
What are some alternatives to Pyrasite?
Similar open-source tools in the Developer Tools category include Laravel Telescope, Visual Studio Code and kitty. SaaS products in the same category include CookieEditor, HookSense and inspectDev.
Is Pyrasite actively maintained?
The most recent commit to Pyrasite was on 7 April 2025. The project has 2.9k stars on GitHub.

Open-source alternatives to Pyrasite

See all

SaaS alternatives to Pyrasite

See all