Repository navigation
ogdf-py 0.1.1
Python bindings for the Open Graph Drawing Framework (OGDF), built with nanobind.
This is a curated subset of OGDF, not a full wrapper: enough to build graphs, run layout and core graph algorithms, style and draw them, and read/write common graph file formats.
[0.1.1]
Added
-
OGDF bindings (curated subset):
Graph/Node/Edgewith iteration;NodeArray/EdgeArrayin int/double/bool;GraphAttributeswith coordinates, size, labels, and styling (colors, shapes, fill patterns, stroke, edge arrows, bends). -
Layout algorithms:
SugiyamaLayout,FMMMLayout,GEMLayout,SpringEmbedderKK,StressMinimization,PivotMDS,PlanarizationLayout(with optional orthogonal routing),SchnyderLayout,TreeLayout,CircularLayout. -
Core graph algorithms: connectivity/structure predicates, connected / strong / biconnected components, topological numbering, Dijkstra shortest paths, minimum spanning tree, maximum flow, global minimum cut, matching, node coloring, and planar embedding.
-
Graph generators: complete, complete-bipartite, wheel, cube, grid, Petersen, regular tree, plus random graphs, trees, digraphs, and regular / biconnected / planar variants.
-
File I/O: interchange formats GML, GraphML, DOT, GEXF, GDF, TLP (with extension-based
read/write) and drawing output as SVG and TikZ. -
demos/folder with illustrative scripts (layout gallery, styling showcase, algorithm visualizations, generator zoo, I/O round-trips) writing tobuild/demo-output;make demosalso builds a self-contained HTML gallery (index.html) of every drawing. -
Bindings split into modular translation units (
bind_graph,bind_layouts,bind_algorithms,bind_io,bind_generators). -
Auto-generated
_core.pyitype stub for typed usage and IDE completion. -
cibuildwheelrelease workflow building CPython 3.10-3.13 wheels for Linux (x86_64, aarch64) and macOS (x86_64, arm64) on native runners, bootstrapping OGDF once per platform; trusted-publishing jobs for TestPyPI/PyPI on tags. -
CMake auto-bootstraps OGDF if missing, so
pip installfrom an sdist works without a manual step (Unix only).
Changed
-
Reproducible OGDF dependency:
scripts/bootstrap_ogdf.shshallow-clones OGDF at a pinned tag (foxglove-202510) and builds its static libraries from source; the extension links them.make build/make syncauto-bootstrap if needed. Replaces reliance on a manually placed OGDF checkout. -
Persist the CMake build directory so only the bindings recompile on edits.
Fixed
-
make buildtargeted the wrong package name (ogdfvsogdf-py), making it a silent no-op; it now rebuilds correctly. -
The generic
writenow raisesValueErrorfor attribute-incapable formats (e.g. LEDA, Chaco) instead of crashing the interpreter.
[0.1.0]
Added
-
Initial project structure
-
Core module with example functions
-
Test suite with pytest
-
Build system using scikit-build-core