========
memhunt
========
memhunt is a modern Python memory debugging and profiling toolkit, originally based on z3c.memhunt.objgraph.
This package has been completely modernized to work with Python 3.8+ and is now framework-agnostic.
memhunt uses objgraph and pympler to help locate and diagnose memory leaks in Python applications.
It provides both web-based interfaces (using Jinja2 templates) and programmatic APIs for memory analysis.
Features
--------
* Memory usage analysis and reporting
* Object reference counting and visualization
* Memory leak detection
* Reference graph generation (requires graphviz)
* Framework-agnostic (works with any Python application)
* FastAPI integration example
* Modern Jinja2 templates for web interfaces
* Comprehensive test suite
Installation
------------
Install memhunt using pip:
pip install memhunt
For FastAPI integration:
pip install memhunt[fastapi]
For development:
pip install memhunt[dev]
Quick Start
-----------
Basic memory analysis:
from memhunt.browser.views import DebugView
debug = DebugView()
print(debug.memory()) # Print memory summary
print(debug.get_biggest_offender()) # Find biggest memory consumer
Web interface example with FastAPI:
from fastapi import FastAPI
from memhunt.browser.views import Start, DebugView
app = FastAPI()
@app.get("/memhunt/")
def memory_debug():
view = Start()
return view()
@app.get("/memhunt/memory")
def memory_summary():
debug = DebugView()
return {"memory": debug.memory()}
Requirements
------------
* Python 3.8+
* pympler>=0.9
* objgraph>=3.5.0
* jinja2>=3.0.0
For graphical output (optional):
* graphviz
Testing
-------
Run tests:
pytest tests/
With coverage:
pytest tests/ --cov=memhunt --cov-report=term-missing
License
-------
This package is licensed under the Zope Public License (ZPL) 2.1.
Metadata
Release files for memhunt 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memhunt-0.0.1.tar.gz | 14.5 kB | Without provenance | Details for memhunt-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memhunt-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for memhunt-0.0.1-py3-none-any.whl |
Total release size: 28.3 kB
Release files / memhunt-0.0.1.tar.gz
| Download URL | memhunt-0.0.1.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
901450c6f833655967d4deb6e3a27c0da1efaf44b4bb3f68fad7073202b55329
|
|
BLAKE2b-256 checksum How to use checksums |
e8e0a4c90be22eda135fdf47da983375b9ab4eb93715073b52e7f0b15e4a698d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / memhunt-0.0.1-py3-none-any.whl
| Download URL | memhunt-0.0.1-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ba53b0ea456e9a2335dcbe555eab9714c11ed609dbcfff39d4f3fa42b3e97e9
|
|
BLAKE2b-256 checksum How to use checksums |
e1051770f91cdf379fc04f56ace34c03ab4c35b89ad80da35f5a1f77252da967
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for memhunt 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.