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)))
Metadata
Release files for tidygraphtool 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tidygraphtool-0.2.1.tar.gz | 19.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tidygraphtool-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / tidygraphtool-0.2.1.tar.gz
| Download URL | tidygraphtool-0.2.1.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d58ecb4d66c9e2ee039607022019fcd0d51d07530d9762ac57ee5fef22f34cfc
|
|
BLAKE2b-256 checksum How to use checksums |
c1c2b0868aba51e4941af0a216a2362cc0e6f9b33ec04f249c7c71e7f21d5ba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / tidygraphtool-0.2.1-py3-none-any.whl
| Download URL | tidygraphtool-0.2.1-py3-none-any.whl |
|---|---|
| Size | 24.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4b397b29a79a03ae477f4e93fbf1953084964a1959746c84f85c712248d98c7
|
|
BLAKE2b-256 checksum How to use checksums |
612912f6c72114807649d4084867a81712e8aa0d3a1dfe17be66f88fb4d63df8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|