Skip to content

Instantly share code, notes, and snippets.

Importing GraphML files generated with graph-tool in NetworkX

GraphML does not support vector types, but they are in the GraphML extension used by graph-tool and Netzschleuder.

A workaround that allows importing graphs in this extended GraphML format is to replace all vector types by a string in which elements are separated by a comma, as suggested here.

from pathlib import Path

graphml_filename = 'path to file'
@antoineallard
antoineallard / remove-annotations.sh
Created June 25, 2018 08:32 — forked from stefanschmidt/remove-annotations.sh
Remove all annotations from a PDF document
pdftk original.pdf output uncompressed.pdf uncompress
LANG=C sed -n '/^\/Annots/!p' uncompressed.pdf > stripped.pdf
pdftk stripped.pdf output final.pdf compress