A tidy API for network manipulation with Graph-tool inspired by tidygraph.
Project description
tidygraphtool
A tidy API for network manipulation with graph-tool library inspired by tidygraph. This is an experimental project of mine. Use at your own risk.
Usage
from tidygraphtool.all import *
g = play_sbm(n_k=500)
(
g >>
activate("nodes") >>
add_property("degree", centrality_degree, mode="total") >>
filter_on("degree == 2") >>
summary()
)
Installation
Installation is a bit weird because graph-tool cannot be pip-install. The easiest way to install is to clone this repo, then from the root directory of the package:
conda env create --file tidy_gt.yml &&
conda activate tidy_gt &&
pip install tidygraphtool
The first and second lines create an environement with all the depenencies from gt.yml. The third line install tidygraphtool from pypi the package at large within the gt environment.
INSPIRATION
graph_tool: tidygraph is thin wrapper of graph_tool (https://graph-tool.skewed.de/).tidygraph: the tidy API that cast graph analysis as two dataframe (https://github.com/thomasp85/tidygraph).dplyr: verbs like API from which tidygraph draw inspiration .
MODELS TO INTEGRATE
hSBM_Topicmodel: topic modeling based on graph_tool (https://github.com/martingerlach/hSBM_Topicmodel)bipartiteSBM: bipartite community detection based on graph_tool (https://github.com/junipertcy/bipartiteSBM)
PROTOYPE FUNCTIONAL INTERFACE
#### Current
g = gt_graph(nodes=nodes, edges=edges)
g = add_property(g, "node_coreness", node_coreness)
g = add_property(g, "pr", centrality_pagerank)
g = filter_on(g, "node_coreness > 3")
g = activate(g, "edges")
g = add_property(g, "edge_bet", centrality_edge_betweenness)
g = gt_graph(nodes=nodes, edges=edges)
g = (g >>
add_property("node_coreness", node_coreness(g)) >>
add_property("pr", centrality_pagerank(g)) >>
filter_on("node_coreness > 3 & pr > 10") >>
activate("edges") >>
add_property("edge_bet", centrality_edge_betweenness(g)))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tidygraphtool-0.2.1.tar.gz.
File metadata
- Download URL: tidygraphtool-0.2.1.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d58ecb4d66c9e2ee039607022019fcd0d51d07530d9762ac57ee5fef22f34cfc
|
|
| MD5 |
8f7ea9d26b15138a265a0717efb89f8a
|
|
| BLAKE2b-256 |
c1c2b0868aba51e4941af0a216a2362cc0e6f9b33ec04f249c7c71e7f21d5ba0
|
File details
Details for the file tidygraphtool-0.2.1-py3-none-any.whl.
File metadata
- Download URL: tidygraphtool-0.2.1-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4b397b29a79a03ae477f4e93fbf1953084964a1959746c84f85c712248d98c7
|
|
| MD5 |
0ffa8f6c8036cebbd98a21cf5717c58a
|
|
| BLAKE2b-256 |
612912f6c72114807649d4084867a81712e8aa0d3a1dfe17be66f88fb4d63df8
|