spmviz: mining and visualizing frequent sequences in Python
spmviz mines frequent sequences from event logs — clicks, alarms, operator actions, moves, daily activities — and shows them. It implements the network-based visualization of frequent sequences of Bántay and Abonyi (PLOS ONE 19(5): e0301262, 2024): the weighted extension network (NBVFS-WN) and the confidence- and transaction-based maps (NBVFS-CM, NBVFS-TM). Around it the package collects nearly forty views from data mining, visual analytics, process mining and social-science sequence analysis, adds several new ones, and connects everything to the Python ecosystem.
| Module | Contents |
|---|---|
spmviz.data, spmviz.patterns |
SequenceDatabase (itemsets, timestamps, attributes, labels) and PatternSet (supports, supporting sequences, parents, confidences, closed/maximal/generator subsets, rules, incidence matrix) |
spmviz.mining |
PrefixSpan, SPAM, CM-SPAM, SPADE, GSP with gap, span and time constraints; top-k; sequential rules; WINEPI/MINEPI episodes |
spmviz.backends |
adapters to the prefixspan, seq2pat and gsppy packages and to the SPMF Java library |
spmviz.nbvfs |
the NBVFS estimator: WN, CM, TM and fused maps, with stress, NetworkX graph and file export |
spmviz.measures, spmviz.networks, spmviz.embedding |
interestingness measures, continuation entropy, group contrasts, similarities; extension networks, prefix trees, transition graphs, lattices, higher-order networks, pattern communities and sub-logs; SMACOF, similarity network fusion, landscapes |
spmviz.viz |
glyph tables, trees, sunbursts, icicles, LifeFlow, double trees, Sankey, DFG, MatrixWave, chord, growth Sankey, HON, incidence and similarity matrices, rule matrices, measure scatter, landscapes, lattices, UpSet, index plots, chronograms, dotted charts, sequence logos, arc diagrams, episodes, MDL covers, prediction, dashboard |
spmviz.interactive |
plotly sunbursts, icicles, treemaps, Sankey diagrams and maps; pyvis networks |
spmviz.summary, spmviz.predict |
MDL summaries; next-event prediction from the longest matching frequent sequence |
spmviz.io |
pandas event logs, SPMF, XES, pm4py; CSV, JSON, Excel; GEXF (Gephi), GraphML, GML, Cytoscape JSON, node-link JSON, DOT, Pajek, igraph |
spmviz.datasets |
the click-stream (BPI Challenge 2016) and alarm logs of the paper, textbook databases, melodies, chess openings, generators, nine SPMF benchmark databases |
Installation
pip install spmviz
Python ≥ 3.10; depends on numpy, scipy, networkx, pandas and matplotlib.
pip install "spmviz[all]" adds plotly, pyvis, igraph, openpyxl, pm4py and the
external miners.
Quick start
import spmviz as sv
from spmviz.viz import plot_sunburst, plot_prefix_tree
db = sv.datasets.load_clickstream() # 343 sessions, 14 services
ps = sv.mine(db, min_support=0.01, max_gap=1, max_length=10)
print(ps) # 241 frequent sequences
ps.to_frame().head() # supports, confidences, lift, ...
sv.NBVFS("wn", start_items=[2]).fit(ps).plot() # weighted extension network
sv.NBVFS("cm").fit(ps).plot() # confidence-based map
sv.NBVFS("tm").fit(ps).write("clickstream_tm.gexf") # for Gephi
plot_sunburst(db) # how the sessions begin
plot_prefix_tree(db, color_by="entropy") # where the next step is uncertain
sv.predict_next(ps, [0, 1]) # what comes next
Documentation and book
- Documentation, gallery of 36 runnable examples and API reference: https://complexsystemsintelligence.github.io/spmviz
- The companion book, Mining and Visualizing Frequent Sequences in Python: The spmviz toolbox (CC BY 4.0): PDF, EPUB, web edition
Citing
Please cite the toolbox and the original NBVFS paper (see CITATION.cff):
J. Abonyi, L. Bántay, spmviz: mining and visualizing frequent sequences in Python, version 1.0, 2026.
L. Bántay, J. Abonyi, Network-based visualisation of frequent sequences, PLOS ONE 19(5) (2024) e0301262, doi:10.1371/journal.pone.0301262.
Acknowledgments
Developed at the University of Pannonia, Veszprém, by the Complex Systems Intelligence group (abonyilab.com). The research was supported by the National Research, Development and Innovation Office of Hungary (NKFIH) through the OTKA 143482 project.
License
MIT for the software; CC BY 4.0 for the book.
Metadata
Release files for spmviz 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 |
|---|---|---|---|---|
| spmviz-1.0.tar.gz | 282.1 kB | With provenance | Details for spmviz-1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| spmviz-1.0-py3-none-any.whl | Python 3 | none | any | Details for spmviz-1.0-py3-none-any.whl |
Total release size: 557.3 kB
Release files / spmviz-1.0.tar.gz
| Download URL | spmviz-1.0.tar.gz |
|---|---|
| Size | 282.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4ee74931cb03321dd104c94ed9950c8203b2294225c15609b66c22279178c81
|
|
BLAKE2b-256 checksum How to use checksums |
4fd9fe39cc181384ffeb98146cc7d43943347622bbe59a2568d3685bf3f4ecc8
|
| 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 / spmviz-1.0-py3-none-any.whl
| Download URL | spmviz-1.0-py3-none-any.whl |
|---|---|
| Size | 275.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02cb5ca6afded703939f287e4212b5a6c20012af5635c370d94258f8b0296620
|
|
BLAKE2b-256 checksum How to use checksums |
e48f0c5eeff163701c22fe23a02fcadf4fde879820b4986b2f7ddcb59c190e0a
|
| 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 spmviz 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 spmviz-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.