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.1

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.1
File Size Uploaded Provenance Actions
xgi-1.1.tar.gz 1.2 MB Without provenance Details for xgi-1.1.tar.gz

Built distribution (wheel)

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

Total release size: 2.4 MB

Release files / xgi-1.1.tar.gz

Download URL xgi-1.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
223be512ea0d7c55c09b74750cfe75274f11d0d760658da4e218dfdcf5b7f9a9
BLAKE2b-256 checksum
How to use checksums
264a00bd75897b2ade9ae132f08206676388efba596f793881f1ffd7eb125f7f
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.1-py3-none-any.whl

Download URL xgi-1.1-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7e8cc82ac3df6984d3551bc84c0dacc297a3831fd51315f32545b03a093dc1e9
BLAKE2b-256 checksum
How to use checksums
48bd95c57a1977d64e2e1451d424bea3f2b2e94d674a22713608df14e19384c1
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.1

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.1 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