retworkx
A High-Performance Graph Library for Python
What it is and what it does
retworkx is the deprecated package name for rustworkx, a high-performance graph library for Python implemented in Rust. It provides graph data structures (directed and undirected) and a suite of graph algorithms including shortest-path calculations, traversals, and other network operations. The package is designed for performance and is suitable for applications ranging from quantum computing transpilers to general network analysis.
The package has been retired in favor of rustworkx, which is described as a drop-in replacement. Users installing retworkx will actually get rustworkx as its runtime dependency. The library supports Python 3.9 through 3.13 and offers optional visualization modules via matplotlib or graphviz when those dependencies are installed separately.
Use it for:
- Computing shortest paths and other algorithms on directed or undirected graphs
- Building and manipulating network structures for quantum computing transpilers or DAG-based workflows
- Analyzing network topology and connectivity in scientific or research applications
- Visualizing graphs using matplotlib or graphviz integration when optional dependencies are present
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A deprecated package name for rustworkx, a high-performance graph library written in Rust that provides graph data structures and algorithms for Python.
No—retworkx is deprecated and retired. Install rustworkx instead, which is the active successor and is described as a drop-in replacement. The fact sheet itself recommends rustworkx over retworkx. If you are already using retworkx, migration to rustworkx is the appropriate path forward.
Install
retworkx on PyPI
pip
pip install retworkxuv
uv add retworkxpoetry
poetry add retworkxInstalling retworkx
Before you install
Low install friction with precompiled wheels available for common platforms. Active maintenance with last commit on 2026-08-07. However, this is the deprecated package name; rustworkx is the actively maintained successor and recommended replacement.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install retworkx
import rustworkx
graph = rustworkx.PyGraph()
a = graph.add_node("A")
b = graph.add_node("B")
graph.add_edges_from([(a, b, 1.5)])
Requires Python >= 3.9. Building from source requires Rust >= 1.79 and cargo. Precompiled binaries available for x86_64, i686, ppc64le, s390x, aarch64 Linux; x86_64 macOS; and 32/64-bit Windows.
Verify before relying
- Whether retworkx will continue to receive security updates or if users must migrate to rustworkx immediately
- Exact compatibility guarantees between retworkx 0.17.1 and rustworkx as a drop-in replacement
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — rustworkx |
| Maintenance | actively maintained — 333 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,881/month — #13,053 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: retworkx-0.17.1-py3-none-any.whl
Keywords: Networks, Network, Graph, Graph Theory, DAG
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
rustworkxA high-performance graph library for Python,…
permissive · top 5,000 on PyPI
chalkpy-rsProvides a native Rust extension package that…
unclear · top 15,000 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
setuptools-rustsetuptools-rust is a setuptools plugin that…
permissive · top 5,000 on PyPI
kailash-enterpriseA Rust-compiled workflow orchestration engine…
unclear · top 15,000 on PyPI
altgraphaltgraph constructs and analyzes graphs…
permissive · top 5,000 on PyPI
graspologic-nativeProvides a high-performance Rust implementation…
permissive · top 15,000 on PyPI
tensor-grepA high-performance grep-compatible command-line…
unclear · top 15,000 on PyPI
moviepilot-rustProvides Rust-accelerated parsing and filtering…
unclear · top 15,000 on PyPI
baseten-performance-clientA high-performance Python HTTP client for…
unclear · top 15,000 on PyPI