hatvis: hypergraph analysis and visualization in Python
hatvis is a Python toolbox for the analysis and visualization of hypergraphs, the natural model of interactions that join more than two entities at once: a manufacturing task that needs an operator, a robot and a fixture together, a news article that combines several topics, a customer requirement served by several engineering solutions. It is the Python successor of two tools of the Abonyi group at the University of Pannonia, the MATLAB-based HAT-VIS (Czvetkó and Abonyi, SoftwareX 2024) and the interactive HyperGodot viewer (Ficsor et al., SoftwareX 2025). It contains the hypergraph methods of the group's work on quality function deployment (Heliyon 2022) and on collaborative manufacturing spaces (J. Manuf. Syst. 2022), and the most useful methods of the wider literature, from s-walk centralities and hypergraph modularity to h-motifs, validated hyperedges and hypergraph neural networks. Data move to and from HyperNetX, XGI and Hypergraphx through converters and the Hypergraph Interchange Format (HIF).
| Module | Contents |
|---|---|
hatvis.core |
Hypergraph (sparse incidence matrix, weights, fuzzy memberships, α-cuts, attributes, dual, restriction), DirectedHypergraph, TemporalHypergraph |
hatvis.representations |
clique and star expansions, line and s-line graphs, intersection and co-occurrence matrices, Laplacians (normalized, random-walk, Bolla, clique), adjacency, degree and Laplacian tensors, simplicial closure |
hatvis.io |
HIF, HyperGodot and SPMF files, incidence CSV and Excel; converters to and from HyperNetX, XGI, Hypergraphx and NetworkX bipartite graphs |
hatvis.seriation |
barycentric (HAT-VIS), correspondence-analysis and hierarchical (optimal leaf ordering) ordering of incidence matrices, quality measures, bicluster blocks |
hatvis.layout, hatvis.similarity |
HAT-VIS similarity with max-product transitive closure, classical MDS and Sammon mapping, HyperGodot force-directed layout, a membership-aware layout, circular, radial, spectral and bipartite layouts, layout quality (stress, intrusions), hypergraph distances |
hatvis.plotting, hatvis.interactive |
seven hyperedge styles (hull, padded concentric hull, smooth curve, isocontour, minimum-volume ellipse, star, spanning tree), seriated incidence matrices, PAOH and UpSet views, house of quality, primal-dual views, s-walk and motif profiles, interactive HTML viewer |
hatvis.metrics, hatvis.centrality, hatvis.spectral |
s-components, s-distances and s-profiles; s-betweenness and s-closeness, clique, Z-, H- and nonlinear node-edge eigenvector centralities, PageRank, hyper-cores; random walks and spectral embedding; clustering, assortativity, nestedness, simpliciality |
hatvis.community, hatvis.partition |
strict and all-or-nothing hypergraph modularity, hypergraph Louvain, label propagation, spectral clustering and co-clustering, Fiduccia-Mattheyses bisection, cut and connectivity metrics |
hatvis.patterns |
itemset hypergraphs, frequent, closed and maximal itemsets, association-rule hyperarcs, ARHP clustering weights, statistically validated hyperedges, inclusion lattices and formal concepts |
hatvis.motifs, hatvis.models |
the 26 h-motifs and node motifs with z-scores; uniform, random, Chung-Lu, configuration and planted-partition models |
hatvis.problems, hatvis.qfd |
set cover and hitting set (exact ILP and greedy), minimal transversals, matching, coloring and 2-colorability, GYO reduction and join trees, conformality, Helly property, B-reachability and shortest hyperpaths; hypergraph and network-flow based quality function deployment |
hatvis.dynamics, hatvis.learning, hatvis.temporal |
diffusion, nonlinear group consensus, threshold contagion; label spreading, HGNN features and classifier, hyperedge prediction; turnover, persistence, differences and temporal centrality |
hatvis.datasets |
the HAT-VIS and HyperGodot examples, the collaborative manufacturing cyber-physical system, the electric-car QFD, a wire-harness assembly network and a synthetic news-topic generator |
Installation
pip install hatvis
pip install "hatvis[interop]" # HyperNetX, XGI, Hypergraphx converters and Excel input
Python ≥ 3.10; depends on numpy, scipy, pandas, networkx, scikit-learn and matplotlib.
Quick start
import hatvis as hv
from hatvis.plotting import draw_hypergraph, plot_incidence
H = hv.Hypergraph({"e1": ["v1", "v2", "v3"], "e2": ["v1", "v2", "v4"], "e3": ["v3", "v4", "v5"]})
H.degrees() # pandas Series indexed by the vertices
S = hv.vertex_similarity(H, transitive=True) # HAT-VIS similarity
hv.s_betweenness(H, s=2) # s-walk centrality of the hyperedges
draw_hypergraph(H, layout="membership", style="smooth")
plot_incidence(H, order="barycentric")
hv.to_html(H, "my_hypergraph.html") # interactive viewer in the browser
cps = hv.datasets.load_manufacturing_cps() # collaborative manufacturing space
hv.community.hypergraph_louvain(cps, random_state=0)
Documentation and book
- Documentation: https://complexsystemsintelligence.github.io/hatvis, with an example gallery of 39 scripts (each can be opened as a Jupyter notebook or in Google Colab) and the API reference.
- Book: Hypergraph Analysis and Visualization in Python: The hatvis toolbox by János Abonyi, Tímea Czvetkó and Attila Ficsor, 13 chapters and 3 appendices: read online, PDF, EPUB. The book develops every method in one notation and uses the gallery scripts as its examples, so the book, the documentation and the code show the same numbers.
Development
git clone https://github.com/ComplexSystemsIntelligence/hatvis.git
cd hatvis
pip install -e ".[dev]"
pytest # unit tests and doctests
python docs/build_api_pages.py && sphinx-build -b html docs docs/_build/html
book/build.sh # book PDF (TeX Live, latexmk, biber)
DESIGN.md fixes the notation and the API conventions shared by the code,
the documentation and the book.
Citing
If you use hatvis, please cite it (see CITATION.cff) together with the
original publications of the methods you use; the docstrings and the book
list them. The predecessors of the toolbox are
- T. Czvetkó, J. Abonyi, Version [1.0]- HAT-VIS — A MATLAB-based hypergraph visualization tool, SoftwareX 28 (2024) 101963, doi:10.1016/j.softx.2024.101963
- A. Ficsor, T. Czvetkó, V. Sebestyén, J. Abonyi, HyperGodot: Interactive hypergraph visualization tool, SoftwareX 31 (2025) 102315, doi:10.1016/j.softx.2025.102315
- J. Abonyi, T. Czvetkó, Hypergraph and network flow-based quality function deployment, Heliyon 8 (2022) e12263, doi:10.1016/j.heliyon.2022.e12263
- L. Nagy, T. Ruppert, A. Löcklin, J. Abonyi, Hypergraph-based analysis and design of intelligent collaborative manufacturing space, J. Manuf. Syst. 65 (2022) 88–103, doi:10.1016/j.jmsy.2022.08.001
License and acknowledgment
Code: MIT License. Book (book/ directory): CC BY 4.0.
The development was supported by the National Research, Development and Innovation Office of Hungary (NKFIH) through the OTKA K 143482 project Monitoring complex systems by goal-oriented clustering algorithms.
Metadata
Release files for hatvis 1.0
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 |
|---|---|---|---|---|
| hatvis-1.0.tar.gz | 129.1 kB | With provenance | Details for hatvis-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hatvis-1.0-py3-none-any.whl | Python 3 | none | any | Details for hatvis-1.0-py3-none-any.whl |
Total release size: 244.1 kB
Release files / hatvis-1.0.tar.gz
| Download URL | hatvis-1.0.tar.gz |
|---|---|
| Size | 129.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0c04a5cfd0144b3c0cf478637486fbdcc9b7f1a13a2f24f44b7855d8fcf4a042
|
|
BLAKE2b-256 checksum How to use checksums |
11b3c238d892f4138aaf253a68d134fa370fc3bf6e800bef52b484d0bd1cbb6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / hatvis-1.0-py3-none-any.whl
| Download URL | hatvis-1.0-py3-none-any.whl |
|---|---|
| Size | 114.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9243ca77efd0272e71bd3f92e00efaf0605ec257920201e0a0c82d7608e70175
|
|
BLAKE2b-256 checksum How to use checksums |
7458215567e6c88c86f9093dc88f8e7c35c0789da9da9a039e0356231dedeed3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for hatvis 1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for hatvis-1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA 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.