skillfed

hunter

Hunter is a flexible code tracing toolkit.

hunter v3.9.0 1.1M downloads/30d#4,402 on PyPI872
Permissive license BSD-2-Clause AGING released

What it is and what it does

Hunter is a code tracing toolkit that uses Python's sys.settrace hook to intercept and log execution events—function calls, line executions, returns, and exceptions—with flexible filtering and customizable output actions. It is not a coverage tool but a debugging and inspection instrument, useful for understanding code flow, tracking variable state, and diagnosing runtime behavior.

You configure it by passing filters (module name, function name, conditions) and actions (CallPrinter, CodePrinter, VarsPrinter, or custom handlers) to the trace() function. It supports terminal output with optional colors, can be activated via environment variables, and includes a CLI tool to attach to running processes. The package depends on manhole for process attachment capability.

Use it for:

  • Debug a function by tracing all calls within a specific module and printing their arguments and return values.
  • Inspect variable state at each line of execution to understand how values change through a code path.
  • Attach to a running process to trace execution without stopping or restarting it.
  • Log all calls to a third-party library to understand its internal behavior and call sequence.
  • Drop into a debugger (pdb) conditionally when a specific function or condition is encountered during execution.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Hunter is a code tracing toolkit that intercepts and logs function calls, line executions, and variable changes for debugging and inspection without measuring coverage.

Yes, if you need flexible runtime code tracing for debugging or inspection. Hunter is stable (Production/Stable status), has no known vulnerabilities, and low install friction. The aging maintenance (357 days since last release) is a minor concern but the repository is active and supports current Python versions. Install it when you need to trace execution flow, inspect variables, or understand third-party code behavior without coverage measurement.

Install

hunter on PyPI

pip

pip install hunter

uv

uv add hunter

poetry

poetry add hunter

Installing hunter

Before you install

Low friction installation with a single pure-Python runtime dependency (manhole). Last release was 357 days ago; repository is active and not archived, though maintenance status is aging.

License in practice

BSD-2-Clause is permissive and poses no restrictions on commercial or private use, modification, or redistribution.

Quickstart

pip install hunter

import hunter
hunter.trace(module='os.path', action=hunter.CallPrinter)
import os
os.path.join('a', 'b')

Requires Python 3.9 or later. For process attachment via CLI, the manhole dependency must be installed (included automatically).

Verify before relying

  • Whether the aging maintenance status (357 days since release) affects compatibility with the latest Python versions (3.13 is listed as supported).
  • Performance overhead of tracing in production environments compared to other tracing solutions.

Package facts

License BSD-2-Clause (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — manhole
Maintenance aging — 357 days since the last release
Last repo commit
First released
Downloads 1,078,499/month — #4,402 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: hunter-3.9.0-pp39.pp310.pp311.graalpy311-none-any.whl

Keywords: trace, tracer, settrace, debugger, debugging, code, source

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: DebuggersTopic :: Utilities

Tags

code tracing debuggerfunction call tracerpython execution tracerline-by-line code inspectionsettrace wrapperdebugging toolkitvariable inspection tracer
debuggingtracinginspection

More Utilities packages