planarity
Python Wrapper for the Edge Addition Planarity Suite and Graph Library
What it is and what it does
Planarity is a Python wrapper around the Edge Addition Planarity Suite (EAPS), a high-performance C library for planar graph algorithms. It provides functions to test whether a graph is planar, compute planar embeddings, generate ASCII-art drawings of planar graphs, and detect forbidden subgraphs. The package has no runtime dependencies and is designed for developers and researchers working with graph theory, discrete mathematics, and algorithm development.
The package accepts graphs as edge lists (tuples of vertex labels) and returns results as booleans, dictionaries, or formatted strings. It is production-stable (Development Status 5) and actively maintained, with support for modern Python versions (3.10–3.14). However, installation requires compilation from source, which adds friction on platforms without a C compiler readily available.
Use it for:
- Verify whether a network topology or circuit diagram can be drawn without edge crossings before layout algorithms.
- Detect and isolate forbidden subgraphs (like K5 or K3,3) in graph-based data structures for constraint checking.
- Generate quick ASCII visualizations of small planar graphs for debugging or documentation.
- Integrate planar graph testing into NetworkX-based graph analysis pipelines.
- Benchmark or validate planar graph algorithms in academic research or algorithm development.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Tests whether a graph is planar, computes planar embeddings, draws planar graphs as ASCII art, and isolates forbidden subgraphs using algorithms from the Edge Addition Planarity Suite.
Yes, if you need planar graph algorithms and can handle compilation. The package is stable, actively maintained, permissively licensed, and has no runtime dependencies. High install friction (source compilation required) is the main drawback; verify your build environment supports C compilation before installing. No known security vulnerabilities.
Install
planarity on PyPI
pip
pip install planarityuv
uv add planaritypoetry
poetry add planarityInstalling planarity
Before you install
High install friction: the package requires compilation from source (tar.gz distribution). Maintenance is active with a recent release (46 days ago) and ongoing repository commits, supporting Python 3.10 through 3.14.
License in practice
BSD-3-Clause permissive license allows commercial and private use with attribution. The license covers both the Python wrapper and the underlying Edge Addition Planarity Suite (EAPS) C library.
Quickstart
import planarity
edgelist = [('a', 'b'), ('a', 'c'), ('b', 'c')]
print(planarity.is_planar(edgelist)) # True
print(planarity.ascii(edgelist)) # ASCII drawing
print(planarity.mapping(edgelist)) # Vertex label to index mapping
Requires Python >= 3.10 and a C compiler to build from source (high install friction).
Verify before relying
- Whether NetworkX integration is automatic or requires explicit setup beyond import.
- Performance characteristics on large graphs (vertex/edge count thresholds).
- Which specific forbidden subgraph algorithms are exposed in the public API.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 46 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 709,596/month — #5,262 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: planarity-1.0.0.tar.gz
Keywords: Graph Theory, Mathematics, Discrete Mathematics, Graph Algorithms, graph, algorithms, math
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
python-igraphPython interface to the igraph graph library…
copyleft · top 15,000 on PyPI
pygraphvizPyGraphviz provides a Python interface to…
permissive · top 5,000 on PyPI
grandalfGrandalf computes node coordinates and routes…
copyleft · top 5,000 on PyPI
asciidagRenders directed acyclic graphs as ASCII art in…
copyleft · top 15,000 on PyPI
minorminerminorminer finds graph minor embeddings—it maps…
unclear · top 15,000 on PyPI
graphttyRenders directed graphs as colored ASCII art in…
permissive · top 15,000 on PyPI
igraphigraph provides a Python interface to a…
copyleft · top 5,000 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
pointpatsPointpats provides statistical methods for…
permissive · top 15,000 on PyPI
asciichartpyRenders line charts as ASCII art in the console…
permissive · top 15,000 on PyPI