Skip to main content

XGI

PyPI Python versions Test Status codecov DOI pyOpenSci Good First Issue Benchmarks

CompleX Group Interactions (XGI) is a Python package for modeling, analyzing, and visualizing higher-order networks: hypergraphs, directed hypergraphs, and simplicial complexes. It covers the whole workflow, from start to finish, with data structures, generative models, measures, datasets, and drawing tools.

Documentation · Tutorials · Gallery · Datasets · Projects using XGI · Contribute

Install

pip install xgi

For other options (development version, optional dependencies), see the installation guide.

Getting started

To get started, take a look at the tutorials illustrating the library's basic functionality.

An example:

import xgi

# build
hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)

# analyze
H.edges.size.asnumpy()          # array([3, 3, 2, 4, 5, 2])
H.nodes.filterby("degree", 3)   # nodes 1, 3, 4

# visualize
pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos)

Drawing of the example hypergraph

XGI-DATA

XGI-DATA is a curated collection of 50+ real-world higher-order datasets (from face-to-face contacts and emails to coauthorships, legislation, and ecology), which can be loaded in one line with xgi.load_xgi_data().

Contribute

Contributions of any size are welcome, and we're happy to help! To report a bug or request a feature, open an issue. For more, see the contributing guide.

Join the community on Zulip and follow XGI on Bluesky.

Cite

We believe that quality software is important for supporting research. To demonstrate the value of XGI, we ask that you cite the XGI paper in your work. You can also use the "Cite this repository" button on GitHub.

Landry, N. W., Lucas, M., Iacopini, I., Petri, G., Schwarze, A., Patania, A., & Torres, L. (2023). XGI: A Python package for higher-order interaction networks. Journal of Open Source Software, 8(85), 5162.

BibTeX
@article{Landry_XGI_2023,
    author = {Landry, Nicholas W. and Lucas, Maxime and Iacopini, Iacopo and Petri, Giovanni and Schwarze, Alice and Patania, Alice and Torres, Leo},
    title = {{XGI: A Python package for higher-order interaction networks}},
    doi = {10.21105/joss.05162},
    journal = {Journal of Open Source Software},
    publisher = {The Open Journal},
    year = {2023},
    month = may,
    volume = {8},
    number = {85},
    pages = {5162},
    url = {https://doi.org/10.21105/joss.05162},
}

License

Released under the 3-Clause BSD license.

Support

NSF   Zulip

See details here.

Looking for something else? See this list of other higher-order network software.

Metadata

Release files for xgi 1.0.0

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

Source distribution (sdist)

Source distribution for xgi 1.0.0
File Size Uploaded Provenance Actions
xgi-1.0.0.tar.gz 1.2 MB Without provenance Details for xgi-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 2.4 MB

Release files / xgi-1.0.0.tar.gz

Download URL xgi-1.0.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
202b5d1db88988941c0bddc7189445c80429b5d4fba9d2dc8c0380f6ebde6f97
BLAKE2b-256 checksum
How to use checksums
eff523e89ac0414ffcbe0f7d0c1d7d2dc182a0ee17f48a78b311e98efd7cd9cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL xgi-1.0.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
cab3df2da47d8b0237737d5eb472c8e65b8b009a77f3c5b2f5831dd0b837f365
BLAKE2b-256 checksum
How to use checksums
a2f0e501f7748c0fcb9c2459ef820d431f854f2f3f859402c744bbb35dcc7edc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for xgi 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

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