--- id: planarity version: "1.0.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # planarity — Python Wrapper for the Edge Addition Planarity Suite and Graph Library License: permissive · Maintenance: active · Downloads: 709.6K/mo ## 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 above — 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 pip install planarity uv add planarity poetry add planarity ## Installing 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_current - Install friction: high - Maintenance: active - Downloads: 709.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags planar graph testing, graph planarity check, planar embedding algorithm, forbidden subgraph detection, graph drawing ascii, planarity testing library, graph algorithms python, graph-algorithms, planar-graphs, computational-geometry [View on SkillFed](https://skillfed.io/packages/planarity) · [View on PyPI](https://pypi.org/project/planarity/)