Skip to main content

Community Discovery Library

Project description

CDlib - Community Detection Library

codecov Build Documentation Status CodeQL pyversions PyPI version Anaconda-Server Badge Code style: black Downloads Downloads DOI SBD++

Twitter

CDlib is a meta-library for community detection in complex networks: it implements algorithms, clustering fitness functions as well as visualization facilities.

CDlib is designed around the networkx python library: however, when needed, it takes care to automatically convert (from and to) igraph object so to provide an abstraction on specific algorithm implementations to the final user.

CDlib provides a standardized input/output facilities for several Community Discovery algorithms: whenever possible, to guarantee literature coherent results, implementations of CD algorithms are inherited from their original projects (acknowledged on the documentation).

If you use CDlib as support to your research consider citing:

G. Rossetti, L. Milli, R. Cazabet. CDlib: a Python Library to Extract, Compare and Evaluate Communities from Complex Networks. Applied Network Science Journal. 2019. DOI:10.1007/s41109-019-0165-9

Tutorial and Online Environments

Check out the official tutorial to get started!

If you would like to test CDlib functionalities without installing anything on your machine consider using the preconfigured Jupyter Hub instances offered by SoBigData++.

Installation

CDlib requires python>=3.8.

To install the latest version of our library just download (or clone) the current project, open a terminal and run the following commands:

pip install -r requirements.txt
pip install -r requirements_optional.txt # (Optional) this might not work in Windows systems due to C-based dependencies.
pip install .

Alternatively use pip

pip install cdlib

or conda

conda create -n cdlib python=3.9
conda config --add channels giuliorossetti
conda config --add channels conda-forge
conda install cdlib

Optional Dependencies (pip package)

To simplify the installation process, the default installation does not include optional dependencies (e.g., graph-tool). If you need them, you can install them manually or run the following command:

pip install 'cdlib[C]'

This option, safe for *nix users, will install all those optional dependencies that require C code compilation.

pip install 'cdlib[pypi]'

This option will install all those optional dependencies that are not available on conda/conda-forge.

pip install 'cdlib[all]'

This option will install all optional dependencies accessible with the flag C and pypi.

(Advanced)

Due to some strict requirements, the installation of a subset of optional dependencies is left outside the previous procedures.

graph-tool

CDlib integrates the support for SBM models offered by graph-tool. To install it refer to the official documentation and install the conda-forge version of the package (or the deb version if in a *nix system).

ASLPAw

Since its 2.1.0 release ASLPAw relies on gmpy2 whose installation through pip is not easy to automatize due to some C dependencies. To address such issue test the following recipe:

conda install gmpy2 
pip install shuffle_graph>=2.1.0 similarity-index-of-label-graph>=2.0.1 ASLPAw>=2.1.0

In case this does not solve the issue, please refer to the official gmpy2 installation instructions.

Optional Dependencies (Conda package)

CDlib relies on a few packages not available through conda: to install them please use pip.

pip install pycombo
pip install GraphRicciCurvature

conda install gmpy2 
pip install shuffle_graph>=2.1.0 similarity-index-of-label-graph>=2.0.1 ASLPAw>=2.1.0

In case ASLPAw installation fails, please refer to the official gmpy2 installation instructions.

Collaborate with us!

CDlib is an active project, any contribution is welcome!

If you like to include your model in CDlib feel free to fork the project, open an issue and contact us.

How to contribute to this project?

Contributing is good, doing it correctly is better! Check out our rules, issue a proper pull request /bug report / feature request.

We are a welcoming community... just follow the Code of Conduct.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdlib-0.4.0.tar.gz (226.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdlib-0.4.0-py3-none-any.whl (263.6 kB view details)

Uploaded Python 3

File details

Details for the file cdlib-0.4.0.tar.gz.

File metadata

  • Download URL: cdlib-0.4.0.tar.gz
  • Upload date:
  • Size: 226.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.8

File hashes

Hashes for cdlib-0.4.0.tar.gz
Algorithm Hash digest
SHA256 52433dd4f7b980f78498f48dc16029801007c5e1cd0c8ac08e3a40e92c517ab0
MD5 d6d19c6bdebfbebbedfae268dba912ce
BLAKE2b-256 107264bdcd311cb3a3727663d2e4798efd4efb1645a4d38264b1a38b757aab3a

See more details on using hashes here.

File details

Details for the file cdlib-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: cdlib-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 263.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.8

File hashes

Hashes for cdlib-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbfefbc929df0109995a179c4dd250461310622a355dd0ae80d50757512d2e50
MD5 e297fb4e250d20d9071c7be11af0bd39
BLAKE2b-256 2ccc370df87f765984794810fdccb29b879c72db2e0ddcd43bace00d8b163656

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page