Infomap Python API¶
Infomap is a network clustering algorithm based on the Map equation. This site documents the Python package: installation, a quick start, usage patterns for NetworkX, igraph and multilayer graphs, and the full API reference.
Quick start¶
pip install infomap
import networkx as nx
import infomap
graph = nx.karate_club_graph()
communities = infomap.find_communities(graph, seed=123, num_trials=20)
print(communities)
Continue to Installation for optional integrations and shell completion, or jump to Quick start for the smallest Python API examples.
For Jupyter, start with the flagship quickstart notebook. It shows the notebook-native Infomap result summary, dataframe inspection, and a copyable static network partition helper.
Choose a path¶
New to Infomap in Python? Start with Quick start.
Working in NetworkX, igraph, sparse matrices, or multilayer graphs? Use API usage patterns.
Working with AnnData or Scanpy? Use Using Infomap with AnnData and Scanpy.
Need GraphML or GEXF files? Use Export GraphML and GEXF.
Learning from executable workflows? Use Notebook examples.
Running many native trials on a cluster? Use Run Infomap on HPC.
Need exact signatures and return types? Use API reference.
Core pages¶
Installation — install the package, optional integrations, and the
infomapCLI entry point.Quick start — small Python API examples for first runs and result access.
API usage patterns — API patterns for common graph containers and result access.
Notebook examples — executed notebooks for practical Infomap workflows and survey companion material.
External resources¶
Infomap user guide — algorithm, options, and file formats.
GitHub repository — source, issues, and discussions.