TOOL

gdflib

gdflib is a small Python library, written by Alessandro Molina (GitHub user amol-), for programmatically generating files in the GDF (GDF) graph format. Its scope is deliberately narrow: it is a serializer, or "dumper," that builds up an in-memory collection of nodes and edges and writes them out as GDF text. It does not parse existing GDF files or provide graph algorithms; for reading and richer manipulation of GDF within a Python workflow, the separate networkx-gdf package (which bridges GDF and NetworkX) is the more common choice.

GDF itself is the native network format of GUESS, the Graph Exploration System, and has since been adopted by other tools, most notably Gephi. It is a compact, CSV-like text format organized into two header-delimited sections: a nodedef line declaring typed node columns (name, label, visual attributes such as color, width, height, x/y position, style, and visibility) followed by node rows, then an edgedef line and edge rows. gdflib mirrors this structure directly. The API centers on a GdfEntries container to which nodes are added and linked; the standard GDF node properties are provided with sensible defaults so unspecified fields are filled automatically.

A distinguishing feature is its declarative, typed schema interface. Custom node classes are defined by subclassing Node and declaring attributes with field types such as String and Double, each optionally carrying a default value or being marked required; edges are extended the same way by subclassing Edge, in which case the explicit add_edge() call replaces the simpler link() helper. Serialization is performed with dumps(), which emits the full nodedef/edgedef document.

The library is best suited to scripts and pipelines that produce graphs for visualization in Gephi or GUESS, or that need a lightweight, dependency-free way to emit GDF without pulling in a full graph toolkit. Its limitations reflect its size and age: it is write-only, lightly documented, minimally maintained (a handful of commits, an early 0.0.x release on PyPI and conda), and covers the practical subset of GDF rather than every attribute variant. For interoperability with formats like GraphML, GML, or GEXF, GDF output from gdflib is typically fed onward into Gephi or a converter such as NetworkX.

Output Formats

Frequently Asked Questions

What graph file formats does gdflib support?

See the list on this page — it shows every format gdflib can read, write and display.

How do I import a graph into gdflib?

Convert your file to a format gdflib can read, then open it in gdflib. Use GraphInOut to get a gdflib-compatible file in seconds.

How do I convert a file so gdflib can open it?

Use the convert links above — upload or paste your graph, pick a format gdflib accepts and download the result, right in your browser.