Skip to main content

pymnet: A Python Library for Multilayer Networks

codecov

pymnet is a Python package for creating, analyzing, and visualizing multilayer networks as formalized by Kivelä et al. (2014). It is designed for network scientists with an easy-to-use yet flexible interface, featuring, inter alia, representations of a very general class of multilayer networks, structural metrics of multilayer networks, and random multilayer-network models.

To learn more about the concepts and design principles underlying pymnet, check out this overview.

Features

  • Written in pure Python
  • Full support for general multilayer networks
  • Efficient handling of multiplex networks (with automatically generated lazy evaluation of coupling edges)
  • Extensive functionality –– analysis, transformations, reading and writing networks, network models, etc.
  • Flexible multilayer-network visualization (using Matplotlib and D3)
  • Integration with NetworkX for monoplex network analysis

Working with pymnet

Installation

We recommend executing the following command in a virtual environment:

$ python -m pip install pymnet

Usage

To get started with pymnet, check out our tutorials –– and when in doubt, consult the API reference contained in our documentation.

As an introductory example, with the following code, we can create a small multiplex network capturing different types of social relations between individuals and visualize the result:

import pymnet

net_social = pymnet.MultiplexNetwork(couplings="categorical", fullyInterconnected=False)
net_social["Alice", "Bob", "Friends"] = 1
net_social["Alice", "Carol", "Friends"] = 1
net_social["Bob", "Carol", "Friends"] = 1
net_social["Alice", "Bob", "Married"] = 1

fig_social = pymnet.draw(net_social, layout="circular", layerPadding=0.2, defaultLayerLabelLoc=(0.9,0.9))

An image of a small multiplex social network.

Contributing

We welcome contributions! Before you get started, please check out our contribution guide.

Asking Questions

Metadata

Release files for pymnet 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pymnet 1.0.0
File Interpreter ABI Platform
pymnet-1.0.0-py3-none-any.whl Python 3 none any Details

Release files / pymnet-1.0.0-py3-none-any.whl

Download URL pymnet-1.0.0-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
36b4a2dae174a18d6fac7ece96ccb264f848100f3be6ddf512de3429c25ecdc8
BLAKE2b-256 checksum
How to use checksums
7374a382d16240a07993f73400945c5ecb1beb3656f65ed6c104ef7a7d72b4b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

0.3.0

1 release file

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page