Metadata-Version: 2.4
Name: memhunt
Version: 0.0.1
Summary: Memory debugging tools for Python applications
Author: Holmes Corporation
Author-email: Daniel Blackburn <danielb@holmescorp.com>
Maintainer-email: Daniel Blackburn <danielb@holmescorp.com>
License: ZPL 2.1
Project-URL: Homepage, https://github.com/blackburnd/memhunt
Project-URL: Repository, https://github.com/blackburnd/memhunt.git
Project-URL: Issues, https://github.com/blackburnd/memhunt/issues
Keywords: memory,objgraph,graphviz,pympler,debugging,profiling
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Zope Public License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.8
Description-Content-Type: text/plain
Requires-Dist: setuptools
Requires-Dist: pympler>=0.9
Requires-Dist: objgraph>=3.5.0
Requires-Dist: jinja2>=3.0.0
Provides-Extra: test
Requires-Dist: pytest>=6.0; extra == "test"
Requires-Dist: pytest-cov>=2.10; extra == "test"
Requires-Dist: pytest-mock>=3.0; extra == "test"
Requires-Dist: coverage[toml]>=5.0; extra == "test"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.68.0; extra == "fastapi"
Requires-Dist: uvicorn>=0.15.0; extra == "fastapi"
Provides-Extra: dev
Requires-Dist: z3c.memhunt.objgraph[test]; extra == "dev"
Requires-Dist: black>=22.0; extra == "dev"
Requires-Dist: flake8>=4.0; extra == "dev"
Requires-Dist: mypy>=0.910; extra == "dev"
Requires-Dist: pre-commit>=2.15; extra == "dev"
Requires-Dist: tox>=3.24; extra == "dev"
Dynamic: requires-python

========
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.
