networkx-gdf
Convert from any graph formatto networkx-gdf Convert from networkx-gdfto any other format
networkx-gdf is a small, single-purpose Python package by Nelson Aloysio that reads and writes NetworkX graphs in the GDF (Graph Data Format). It fills a specific gap: NetworkX ships built-in readers and writers for many interchange formats but not for GDF, so this library supplies the missing bridge as a thin, dependency-light add-on (Python 3.7+, NetworkX 2.1+, pandas 1.1+) released under the MIT license and distributed on PyPI as networkx-gdf.
GDF is a compact, tabular text format originally implemented by the now-unmaintained GUESS tool (see GUESS) and still supported by Gephi. A GDF file is essentially two CSV-style tables: a nodedef> header line declaring node columns and their SQL-like types, followed by node rows, then an edgedef> header declaring edge columns, followed by edge rows. The format supports typed attributes (VARCHAR, INT, LONG, FLOAT, DOUBLE, BOOLEAN), which makes it richer than a bare edge list while remaining human-readable and spreadsheet-friendly.
The API is deliberately minimal: read_gdf() parses a file into a NetworkX graph and write_gdf() serializes a graph back out (or returns the text if no file is given). Both accept node_attr/edge_attr arguments to select all, specific, or no attributes. read_gdf() adds control over graph construction via directed, multigraph, and weighted flags: when left as None these are auto-detected from the file, and when a multigraph is collapsed to a simple graph parallel-edge weights can be summed. pandas is used internally to handle the tabular parsing and type coercion.
In the broader graph-data ecosystem, networkx-gdf is best understood as a targeted format connector for the NetworkX universe (NetworkX), complementing that library's native GEXF and GraphML support and enabling round-trips with Gephi-oriented workflows. It plays a role analogous to other GDF utilities such as gdflib. Its strengths are simplicity, correctness on the round-trip, and typed attribute handling; its limitations are equally clear: it does nothing beyond GDF I/O (no analysis, layout, or visualization), targets only one format, and is a niche project with minimal community footprint, so users needing multi-format conversion or heavy tooling should treat it as one narrow adapter rather than a general solution.
Graph Formats(Input & Output)
Frequently Asked Questions
What graph file formats does networkx-gdf support?
See the list on this page — it shows every format networkx-gdf can read, write and display.
How do I import a graph into networkx-gdf?
Convert your file to a format networkx-gdf can read, then open it in networkx-gdf. Use GraphInOut to get a networkx-gdf-compatible file in seconds.
How do I convert a file so networkx-gdf can open it?
Use the convert links above — upload or paste your graph, pick a format networkx-gdf accepts and download the result, right in your browser.