Metadata-Version: 2.4
Name: buhito
Version: 0.0.1a1
Summary: buhito is a Python library for graph analysis and machine learning
Author-email: Buhito Developers <un_graphlets@lanl.gov>
License: BSD 3-Clause License
Project-URL: Homepage, https://github.com/lanl/buhito
Project-URL: Bug Tracker, https://github.com/lanl/buhito/issues
Project-URL: Source Code, https://github.com/lanl/buhito
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Chemistry
Classifier: Topic :: Software Development :: Libraries
Requires-Python: <3.12,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
License-File: AUTHORS.md
Requires-Dist: numpy<2.0,>=1.21.0
Requires-Dist: networkx<3.0,>=2.8.0
Requires-Dist: pandas<2.0,>=1.5.0
Requires-Dist: scikit-learn<2.0,>=1.2.0
Requires-Dist: scipy<2.0,>=1.9.0
Requires-Dist: numba<1.0,>=0.56.0
Requires-Dist: joblib<2.0,>=1.2.0
Requires-Dist: tqdm<5.0,>=4.64.0
Requires-Dist: rdkit<2026.0,>=2022.9.0
Requires-Dist: matplotlib<4.0,>=3.6.0
Requires-Dist: pillow<10.0,>=9.0.0
Requires-Dist: pydot<5.0,>=4.0.1
Provides-Extra: docs
Requires-Dist: sphinx>=8.0; extra == "docs"
Requires-Dist: sphinx_rtd_theme>=3.0.0rc1; extra == "docs"
Requires-Dist: sphinxcontrib-bibtex>=2.6; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest<10.0,>=8.3; extra == "test"
Provides-Extra: full
Requires-Dist: graphviz; extra == "full"
Requires-Dist: triton; extra == "full"
Dynamic: license-file

# buhito
<img src="https://raw.githubusercontent.com/lanl/buhito/main/assets/buhito_icon.svg" alt="Logo" width="500">

**buhito** is a Python library for enumerating graphlets and analyzing graphlet-based features from graphs. 

## Installation
```bash
git clone https://github.com/lanl/buhito.git
cd buhito
uv sync --all-extras
```

## Quick Start

### Enumerate graphlets with BFS

```python
import networkx as nx
from buhito import generate_subgraphs_breadthwise

G = nx.petersen_graph()

nx.set_node_attributes(G, {n: "C" for n in G.nodes}, "atom_key")
nx.set_edge_attributes(G, {e: "1" for e in G.edges}, "bond_key")

fp, bitinfo = generate_subgraphs_breadthwise(
    G,
    depth=4,
    return_nodewise=False,
    full_hash=True,
    node_key="atom_key",
    edge_key="bond_key"
)

print("Graphlet fingerprint length:", len(fp))
```

### Enumerate graphlets with DFS

```python
from buhito import generate_subgraphs_depthwise

subsets, counts = generate_subgraphs_depthwise(G, maxlen=4)
print("Found graphlet subsets:", len(subsets))
```

## Examples

Available example scripts:

- `examples/plotting_example.py` — visualize graphlets from the Petersen graph
- `examples/qm9/benchmark_graphlet_featurizers_train_test.py` — benchmark featurizers on QM9 chemical properties data

## Run Examples
### QM9
```sh
python examples/qm9/benchmark_graphlet_featurizers_train_test.py \
  --data examples/qm9/qm9data/qm9_processed.csv \
  --max-len 2 3 4 5 6 \
  --repeats 3 \
  --n-jobs -1 \
  --outdir bench_qm9
```

## Testing

```bash
pytest tests/
```

## Package structure

- `src/buhito/` — core features
- `src/buhito/converters.py` — converters to NetworkX graphs
- `src/buhito/plotting.py` — graphlet visualization helpers

## Authors

- Yulia Pimonova (LANL)
- Nicholas Lubbers (LANL)
- Nathan Lemons (LANL)
- Pieter Swart (LANL)

## Citation

If you use `buhito` in your work, please cite this repository. A publication citation is coming.

## Copyright and licensing

`buhito` is released under the BSD-3 License. See `LICENSE.txt` for the full license.


The copyright to `buhito` is owned by Triad National Security, LLC
and is released for open source use as project number O5043.


© 2026. Triad National Security, LLC. All rights reserved.
This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos
National Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S.
Department of Energy/National Nuclear Security Administration. All rights in the program are.
reserved by Triad National Security, LLC, and the U.S. Department of Energy/National Nuclear
Security Administration. The Government is granted for itself and others acting on its behalf a
nonexclusive, paid-up, irrevocable worldwide license in this material to reproduce, prepare.
derivative works, distribute copies to the public, perform publicly and display publicly, and to permit.
others to do so.


