Skip to content

GraphML and GEXF

GraphML and GEXF helpers from annnet.io.graphml.

annnet.io.graphml

Classes

Functions

to_graphml
to_graphml(
    graph,
    path,
    *,
    directed=True,
    hyperedge_mode="reify",
    public_only=False
)

Export via NetworkX with reified hyperedges; sanitize attrs for GraphML.

Also writes a sidecar manifest for lossless re-import.

from_graphml
from_graphml(path, *, hyperedge='reified')

Import via NetworkX; if a sidecar manifest is present, use it as SSOT.

Otherwise, fall back to a best-effort no-manifest import with type restoration.

to_gexf
to_gexf(
    graph,
    path,
    *,
    directed=True,
    hyperedge_mode="reify",
    public_only=False
)

Export an AnnNet graph to GEXF via NetworkX.

from_gexf
from_gexf(path, *, hyperedge='reified')

Import a GEXF graph through NetworkX.