narrativegraphs
Turn a collection of texts into an interactive narrative graph of entities and their relations and explore the structure of your corpus visually.
Installation
pip install narrativegraphs
Quick Start
from narrativegraphs import NarrativeGraph
docs: list[str] = [...] # your list of documents
model = NarrativeGraph().fit(docs)
model.serve_visualizer()
Open the link in your terminal to explore the graph in your browser:
Features
- Plug'n'play solution – get started with a few lines of code
- Interactive browser-based visualizer – shipped with an interactive React app which can be hosted directly from Python, no extra dependencies
- See the original contexts that extracted entities and relations appear in
- Filter and query the graph by statistics, category, or timestamps
- Export graph and data to NetworkX and Pandas for your own custom analyses
- Modular structure – customize or switch out pipeline components to accommodate your use case.
Documentation
Full documentation and tutorials: kasperfyhn.github.io/narrativegraphs
Citation
If you use this package in academic work, please cite:
@software{narrativegraphs,
author = {Fyhn, Kasper},
title = {narrativegraphs: A Python package for narrative graph analysis},
year = {2026},
url = {https://github.com/kasperfyhn/narrativegraphs}
}
Metadata
Release files for narrativegraphs 0.5.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 |
|---|---|---|---|---|
| narrativegraphs-0.5.0.tar.gz | 1.3 MB | Without provenance | Details for narrativegraphs-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| narrativegraphs-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for narrativegraphs-0.5.0-py3-none-any.whl |
Total release size: 1.8 MB
Release files / narrativegraphs-0.5.0.tar.gz
| Download URL | narrativegraphs-0.5.0.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8c3e45a656c89f5a5e4821087f587d3373b76e939de575283a5bbeb4a3d0e94
|
|
BLAKE2b-256 checksum How to use checksums |
7415789d3ca3f0d534f1c48a16f81dd7ea1162b05b1a6ec639b51b9ba8548404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / narrativegraphs-0.5.0-py3-none-any.whl
| Download URL | narrativegraphs-0.5.0-py3-none-any.whl |
|---|---|
| Size | 472.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
77ce7fc19b8f2ba052ef38aed4a640256ff5c2c125c959844eff8307b6695e94
|
|
BLAKE2b-256 checksum How to use checksums |
af790660fe892910e95e18125e7fca18b2e8c81ca738f42b3d8dd314845b9bb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for narrativegraphs 0.5.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.