Metadata-Version: 2.5
Name: anywidget-bloodhound
Version: 0.0.1
Summary: BloodHound graph visualization for Marimo notebooks
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: anywidget,bloodhound,graph,marimo
Requires-Python: >=3.14
Requires-Dist: anywidget>=0.11.0
Requires-Dist: pydantic>=2.0
Requires-Dist: traitlets>=5.0
Description-Content-Type: text/markdown

# anywidget-bloodhound

`anywidget-bloodhound` creates BloodHound's graph visualization for Marimo notebooks (using anywidget). It accepts the response returned by BloodHound's `/api/v2/graphs/cypher` endpoint and provides BloodHound's initial layout, pan, zoom, node dragging, single-node selection.

It does not guarantee Jupyter compatibility and does not include querying, authentication, search, pathfinding, context menus or pretty much anything else from the BloodHound UI.

## Usage

```python
from anywidget_bloodhound import BloodHoundGraph

graph = BloodHoundGraph(graph_response=cypher_response)
graph
```

You can use OpenHound's BloodHound client to run Cypher queries.

The notebook owns BloodHound API calls and error handling. Assigning `graph_response` replaces the current graph. The synchronized `selected_node_id` and derived `selected_node` expose selection to Python. `graph.fit()` resets the camera to the visible graph and `graph.clear()` removes the response and selection.

Run the Marimo example from a source checkout:

```bash
uv run marimo run examples/marimo_bloodhound.py
```

## Development

```bash
uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .

npm --prefix frontend install
npm --prefix frontend run lint
npm --prefix frontend run test
npm --prefix frontend run build
```

## Attribution
The graph renderer is derived from [SpecterOps/BloodHound](https://github.com/SpecterOps/BloodHound). BloodHound is a trademark of Specter Ops; this project is not the full BloodHound UI.