pytextrank
Python implementation of TextRank as a spaCy pipeline extension, for graph-based natural language work plus related knowledge graph practices; used for for phrase extraction of text documents.
Decision gist · record as of 2026-08-14
Yes. PyTextRank is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers a straightforward way to add graph-based phrase extraction to spaCy workflows. Install friction is low and the library is well-documented. Choose it if you need phrase extraction or concept ranking without the overhead of training custom models.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a spaCy language model to be downloaded separately (e.g., en_core_web_sm for English); spaCy itself is a runtime dependency.
- Low install friction with a pure-Python wheel.
- Active maintenance with recent commits and a stable release history since 2017; requires spaCy and a language model as runtime dependencies.
License · maintenance · safety
permissive license (permissive) — MIT license permits commercial use, modification, and distribution with minimal restrictions—suitable for proprietary applications.
last release 2024-02-21 (905 days) · last repo commit 2026-06-24 · 2,218 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 117,031 downloads/mo, #12,184 on PyPI
Alternatives
Verify before relying
python3 -m pip install pytextrank
python3 -m spacy download en_core_web_sm
import spacy
import pytextrank
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("textrank")
doc = nlp("Your text here")
for phrase in doc._.phrases:
print(phrase.text, phrase.rank)- Specific performance characteristics or scalability limits for large documents or corpora
- Comparison of ranking quality across the four implemented algorithms (TextRank, PositionRank, Biased TextRank, TopicRank)
- Memory footprint and computational cost relative to alternative phrase extraction methods
What it is and what it does
PyTextRank is a Python library that brings graph-based text analysis to spaCy by implementing the TextRank algorithm and related variants (PositionRank, Biased TextRank, TopicRank). It works as a spaCy pipeline component, meaning you load a language model, add the textrank pipe, and then process documents to extract ranked phrases and concepts. The library treats text as a graph of words and their relationships, then applies ranking algorithms to identify the most important phrases.
The main use cases are phrase extraction—pulling the top-ranked keywords or key phrases from a document—and low-cost extractive summarization, where you identify the most important sentences or concepts without training a neural model. It also helps convert unstructured text into more structured representations suitable for knowledge graphs. The package depends on spaCy for NLP processing, networkx for graph operations, scipy for numerical work, and several smaller utilities (graphviz, pygments, icecream, GitPython) for visualization and debugging.
Use it for
- Extract top-ranked phrases from research papers, articles, or documents for tagging or indexing
- Perform low-cost extractive summarization by identifying key concepts without training a summarization model
- Build knowledge graphs by extracting and ranking entities and relationships from unstructured text
- Identify important keywords from customer feedback, reviews, or support tickets for categorization
- Rank and filter candidate phrases for downstream NLP tasks like named entity linking or semantic search
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PyTextRank is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers a straightforward way to add graph-based phrase extraction to spaCy workflows. Install friction is low and the library is well-documented. Choose it if you need phrase extraction or concept ranking without the overhead of training custom models.
Install
pytextrank on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance with recent commits and a stable release history since 2017; requires spaCy and a language model as runtime dependencies.
Requires a spaCy language model to be downloaded separately (e.g., en_core_web_sm for English); spaCy itself is a runtime dependency.
License in practice
MIT license permits commercial use, modification, and distribution with minimal restrictions—suitable for proprietary applications.
Quickstart
python3 -m pip install pytextrank
python3 -m spacy download en_core_web_sm
import spacy
import pytextrank
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("textrank")
doc = nlp("Your text here")
for phrase in doc._.phrases:
print(phrase.text, phrase.rank)
Verify before relying
- Specific performance characteristics or scalability limits for large documents or corpora
- Comparison of ranking quality across the four implemented algorithms (TextRank, PositionRank, Biased TextRank, TopicRank)
- Memory footprint and computational cost relative to alternative phrase extraction methods
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 7 packagesGitPythongraphvizicecreamnetworkxpygmentsscipyspacy |
| Maintenance | Actively maintained 905 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 117,031 / month, #12,184 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Human Machine InterfacesTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: VisualizationTopic :: Software Development :: Libraries :: Python ModulesTopic :: Text Processing :: GeneralTopic :: Text Processing :: IndexingTopic :: Text Processing :: Linguistic |
Evidence: pytextrank-3.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “textrank implementation python”
- pytextrankPyTextRank implements graph-based TextRank and related algorithms as…
- py3rijndaelpy3rijndael provides a pure-Python implementation of the Rijndael…
- somacoreProvides the Python reference implementation of the SOMA…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also spacy · sumy · textacy · rake-nltk · negspacy · graphrag · keyphrase-vectorizers · date-spacy · rouge-chinese · torchtext