Import DyNetML into Python, NetworkX, and igraph

dynetml2other provides an importer and a set of wrapper classes for DyNetML files that allow them to be used with several Python graph libraries. Thes wrapper classes also support exporting data in DyNetML format, meaning that it can be created, used with this package, and then save out for analysis with other tools.

The principle helper class is the dynetml2other method:

Imports a DyNetML file into a wrapper class that uses NetworkX, igraph, or Python dictionaries to contain the networks.

dynetml2other.main(dynetml_path, network_format='dict')[source]
Parameters:
  • dynetml_path (str|unicode) – Path to a dynetml file
  • network_format (str|unicode) – The network format; we expect “networkx”, “igraph”, or nothing (“dict”)
Returns:

The data wrapped in the appropriate class and stored in the specified graph library

Return type:

DynamicMetaNetwork|MetaNetwork|None

If the file contains a meta-network, it will be parsed into an instance of MetaNetwork, which stores graph data in dictionaries, or into one of its SubClasses:

MetaNetwork itself contains no graph data, so if you use the base instance you will lose any graph edges.

If the file contains a dynamic meta-network, it will be parsed into a instance of DynamicMetaNetwork, which contains a list of one of the MetaNetwork SubClasses.

Indices and tables

Table Of Contents

Next topic

DynamicMetaNetwork