Python bindings for the Open Graph Drawing Framework (OGDF), built with nanobind.
Project description
ogdf-py
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.
Quick Start
make bootstrap # clone OGDF at the pinned tag and build it from source (once)
uv sync # build the extension
uv run pytest # run the tests
uv build # build a wheel
make build (and make sync) run the bootstrap automatically if OGDF has not been built yet. Use make help for additional targets.
Example
import ogdf
# Build a graph.
g = ogdf.Graph()
ogdf.random_planar_connected_graph(g, 30, 45)
# Attach drawing attributes and run a force-directed layout.
ga = ogdf.GraphAttributes(g)
ogdf.FMMMLayout().call(ga)
# Export to SVG.
ogdf.draw_svg(ga, "graph.svg")
Algorithms operate on the same Graph, writing per-node/edge results into an array you pass in:
g = ogdf.Graph()
ogdf.complete_bipartite_graph(g, 3, 4)
assert ogdf.is_bipartite(g)
component = ogdf.NodeArrayInt(g)
n = ogdf.connected_components(g, component) # -> number of components
What's included
-
Graph model:
Graph,Node,Edge, node/edge iteration. -
Attribute arrays:
NodeArray/EdgeArrayin int, double, and bool. -
Attributes:
GraphAttributeswith coordinates, size, labels, and full styling (colors, shapes, fill patterns, stroke, edge arrows, and bends). -
Layouts:
SugiyamaLayout(layered),FMMMLayout/GEMLayout/SpringEmbedderKK(force-directed),StressMinimization/PivotMDS(stress/MDS),PlanarizationLayout(with optional orthogonal routing),SchnyderLayout(planar straight-line),TreeLayout,CircularLayout. -
Algorithms: connectivity and structure tests (
is_connected,is_biconnected,is_bipartite,is_acyclic,is_planar, ...), connected / strongly-connected / biconnected components, topological numbering, shortest paths (dijkstra), minimum spanning tree, maximum flow, global minimum cut, matching, node coloring, and planar embedding. -
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 (plus extension-based
read/write), and drawing output as SVG and TikZ.
Demos
make demos # writes SVGs and data files to build/demo-output/
The demos exercise layouts, styling, algorithm visualizations, generators, and file I/O, and assemble every drawing into build/demo-output/index.html for a side-by-side view. See demos/README.md for details.
How it builds
scripts/bootstrap_ogdf.sh shallow-clones OGDF at a pinned release tag (foxglove-202510) into thirdparty/ogdf and builds its static libraries from source. The extension then links libOGDF.a / libCOIN.a statically, so wheels are self-contained. Because OGDF is prebuilt once (a couple of minutes), rebuilding the bindings only recompiles _core.cpp and is fast.
The pin can be overridden: scripts/bootstrap_ogdf.sh --tag <tag> or OGDF_TAG=<tag> make bootstrap. In CI, run the bootstrap once per platform (e.g. in cibuildwheel's CIBW_BEFORE_ALL) so OGDF is reused across all Python versions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ogdf_py-0.1.1.tar.gz.
File metadata
- Download URL: ogdf_py-0.1.1.tar.gz
- Upload date:
- Size: 90.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf0c358d9b4453cedaae8dc5d84ae981c0ba679af3f555349f910c1e55bb6354
|
|
| MD5 |
233486c78c068e4a880032fa236bb00a
|
|
| BLAKE2b-256 |
6d99e1f04899e0d16d5823ce48d7ab09cba6d19af081dc77de2e934c6262c349
|
File details
Details for the file ogdf_py-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e356c329645f0e3de10b6a7b8af8684d0aa2b36ade227492891d1e9c00ab5f4
|
|
| MD5 |
c94342be81f496906e20ce8fb0c77cdb
|
|
| BLAKE2b-256 |
2eb89a19f57d771a44c58206b93ba398e434b4f7df9c22996f87248003d96481
|
File details
Details for the file ogdf_py-0.1.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.13, manylinux: glibc 2.26+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72b2f7e5993c725bce666ae8985eb1f9c76afe058ebcee1852c665a36003dbfa
|
|
| MD5 |
21be7db24ab06a973788981dd63c5cc4
|
|
| BLAKE2b-256 |
9ece6a17a6ec2e619a592c240bb54c707bf84a82e19df5bcd4a40cbda0327512
|
File details
Details for the file ogdf_py-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bace79d866eec7b94c5a4cc92211ca362a1c289cd82e94f9f37281ca222930fd
|
|
| MD5 |
9df5e93a7259485054cf8d707ecadbd4
|
|
| BLAKE2b-256 |
984c1396278f8eb3773b9b6c47c66228d321863e47e42196aba402b34a0208db
|
File details
Details for the file ogdf_py-0.1.1-cp313-cp313-macosx_10_15_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp313-cp313-macosx_10_15_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.13, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b63c0c58a628409948f9a6cc24c877c691f065fc85fc7a2fc99419a8a2853d
|
|
| MD5 |
10488c2b0b7162f22b1f1204714e16f7
|
|
| BLAKE2b-256 |
615d279d833c70064485e71c7ee87fee86ddb8f20e92fbd6b39152ed8dd8ad9e
|
File details
Details for the file ogdf_py-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdea58b2efdbefba9e7fcb9afa3cff9b5e1d2518bd60077147fecfb6e2403b28
|
|
| MD5 |
2f04fbae89962220347edc935bc46ff0
|
|
| BLAKE2b-256 |
6a8966b0737c9e9ea6f63b7509417177041751738b615c57a6ca3099fd401f3a
|
File details
Details for the file ogdf_py-0.1.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.26+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4550791092dd9cb50154cd4d6a349d9a26f597d58aaa22bfb3ef81b1b8887b3c
|
|
| MD5 |
63028b3e031ce4697c0e2e249e51a822
|
|
| BLAKE2b-256 |
711b0733ea5c0b481a77ca6f9319dcb1407fb00c14690e1f38b6a3d3bad86ba5
|
File details
Details for the file ogdf_py-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4f143972211e7331c6558babb54fafcf185f035770774f445d1dbec13694ca5
|
|
| MD5 |
b9da974ed8db5f574cd0e8d24dfd0e0d
|
|
| BLAKE2b-256 |
be13960f6824da095da57a82a4e679db5934a4fe76045ebdd9b45a21d76eb21e
|
File details
Details for the file ogdf_py-0.1.1-cp312-cp312-macosx_10_15_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp312-cp312-macosx_10_15_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b947f732ab0eeb773642859d0cec2991d4cfdf15027621a87508d90b8b67d4cd
|
|
| MD5 |
3558447c742ce5e7b8383d9eb2bd34f6
|
|
| BLAKE2b-256 |
e88808a00cdfb628a4336976e7d5943f82b28a60e739486891c4078d3cafc9a0
|
File details
Details for the file ogdf_py-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f8cfb882d55747f05fa8eafa2bcba0625754e68a7289bbe48d1d95d5f033aa7
|
|
| MD5 |
40835f7bd4bf926087de05924e2e2cad
|
|
| BLAKE2b-256 |
86cfd90b08d0abd4e4909b5d2fafc6ee908588489900ec6cee7321e0a67b55b4
|
File details
Details for the file ogdf_py-0.1.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.11, manylinux: glibc 2.26+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f3fadde1ec3edef4740a19c21856476c3b6a6ccce7e41f5571cf420d3a9b358
|
|
| MD5 |
5cc27900b311b5f792162a97563fed52
|
|
| BLAKE2b-256 |
67b6e18205d5236c60090eca3c568db240ff8ffae6eedf05a499c9bc7a669f90
|
File details
Details for the file ogdf_py-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e7bb47f32a5a0f00fff812db163850b45fce088747b65337df1716f933c1bbe
|
|
| MD5 |
b9a33469a4edaf79728daafa624dd502
|
|
| BLAKE2b-256 |
a7f14f1ccd36e1c380fe8e6ecf83fb60a64b8771d2900d61504dee17314b7b08
|
File details
Details for the file ogdf_py-0.1.1-cp311-cp311-macosx_10_15_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp311-cp311-macosx_10_15_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7a1c77303a0ae37b3a6c5b1850014faa9e272f10f85b077ddf43d3f2d937cfc
|
|
| MD5 |
d1d264c36a7f62260323badf6486b9a4
|
|
| BLAKE2b-256 |
f467046e93c1d7afeff09d2ad3cf9571ee9d8f214d846aa9be5777db22a94f73
|
File details
Details for the file ogdf_py-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7cb63bbf934596e8aa936ee9cd1b40b990e06687eb7b815c492094b8a001c4e
|
|
| MD5 |
902556507d8e32de2773bd284045afcb
|
|
| BLAKE2b-256 |
c0de80278593a8852ff707274a8362d39840a1a58fb7b8d2deea168f76c72300
|
File details
Details for the file ogdf_py-0.1.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.10, manylinux: glibc 2.26+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9db5c41123088ccd84a65585e14981cfcc8927a3d87cca2ae74b8478450492f5
|
|
| MD5 |
5a0ed55ee2c4862bf9cb4495e10639be
|
|
| BLAKE2b-256 |
676bf0a7c13e211e6d33b76fdf726d0942398cea8bcac32ede0d52b61fc3c42a
|
File details
Details for the file ogdf_py-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcc9579ff870561f898e1e99e57796f4f30dbfa2638277622a5ba3da61b9898e
|
|
| MD5 |
8017095d0c27b7d89919667c72bbc5ed
|
|
| BLAKE2b-256 |
a14dd329b82171d783847a3630867ee65320b4d2da8979f7f4f7339a7e375b84
|
File details
Details for the file ogdf_py-0.1.1-cp310-cp310-macosx_10_15_x86_64.whl.
File metadata
- Download URL: ogdf_py-0.1.1-cp310-cp310-macosx_10_15_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.10, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bc8628623abe1a63abca49f913550bd6104e5ad743efa54c616b85d94413f38
|
|
| MD5 |
023a3cec66a52d263a738d77dd37f431
|
|
| BLAKE2b-256 |
126f4666bb6807429744be446fefcdea43fac730a6f1d723f2edfb015d295389
|