Skip to main content

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:

visualizer-screenshot.png

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)

Source distribution for narrativegraphs 0.5.0
File Size Uploaded
narrativegraphs-0.5.0.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for narrativegraphs 0.5.0
File Interpreter ABI Platform
narrativegraphs-0.5.0-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page