TOOL

PyNetConvert

PyNetConvert is a lightweight command-line network (graph) format converter written by Artem Lutov of the eXascaleInfolab (University of Fribourg). Its purpose is narrow and practical: translate between the plain-text graph formats commonly encountered in community-detection and graph-clustering research so that datasets can move between analysis tools without manual reformatting. It is distributed as a single Python script (convert.py) with a companion matToNsl.py helper, runs on Python 3 with Python 2/PyPy fallback, and has zero external dependencies, which makes it easy to drop into a benchmarking pipeline.

The tool reads Pajek (Pajek), Metis (METIS), and the family of newline-separated link formats it calls NSL, and writes NSL variants plus its native RCG format. NSL splits into NSE (edges, one undirected link per line as src dst [weight]) and NSA (arcs, directed links given in pairs), and subsumes the ncol (NCOL) and Stanford SNAP edge-list conventions, so it effectively covers generic edge-list (Edge List) data. RCG, the "Readable Compact Graph" format (formerly HIG), is the native input of the author's own DAOC and HiReCS clustering libraries; it resembles Pajek but allows sparse, non-contiguous node ids. A separate script converts MATLAB (.mat) adjacency matrices into NSL.

Architecturally it is a streaming, single-pass parser that keeps memory low unless the --remdup flag is set to deduplicate edges. Input and output formats can be auto-detected from file extensions, and flags control weight stripping (--unweight), comment handling (--nocoms), self-loops (used to encode node weights), and file-overwrite resolution. It handles both directed and undirected, weighted and unweighted graphs.

The honest limitations are scope-related rather than defects. PyNetConvert targets simple, unattributed, integer-id link lists; it does not handle rich attributed or XML-based interchange formats such as GraphML or GEXF, has no property/label model, is batch-only with no GUI, and an open issue requesting RDF import went unaddressed. For that broader interchange work, general-purpose libraries such as NetworkX or igraph, or full converters like GraphInOut, are better fits. Within its intended niche—preparing LFR-benchmark and real-world networks for DAOC/HiReCS and other clustering evaluations—it is a fast, minimal, and predictable utility.

Graph Formats(Input & Output)

Input Formats

Frequently Asked Questions

What graph file formats does PyNetConvert support?

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

How do I import a graph into PyNetConvert?

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

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

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