A tidy API for network manipulation with Graph-tool inspired by tidygraph.
Project description
tidygraphtool
A tidy API for network manipulation with Graph-tool inspired by tidygraph.
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()
)
Features
- tidy and functional API for graph wranling with the graph-tool library.
Setting up conda environment
Graph-tool is best installed in a fresh environment.
conda create --name graph_tool_env &&
conda activate graph_tool_env &&
conda install -c conda-forge graph-tool &&
conda install -c conda-forge ipython jupyter pandas pandas-flavor &&
pip install matplotlib ipykernel
# optional on jupyter notebook
# python -m ipykernel install --user --name=graph_tool_env
INSPIRATION
graph_tool: tidygraph is thin wrapper of graph_tool (https://graph-tool.skewed.de/).networkx: we also draw inspiration from networkx.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 .pyjanitor: general organisation of python data wranling with pandas (https://github.com/ericmjl/pyjanitor).thinc: functional API for deep learning (especially chaining and operator overloading; https://github.com/explosion/thinc).
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)
#### With #pipey, we can currently do
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
tidygraphtool-0.1.tar.gz
(19.1 kB
view details)
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.1.tar.gz.
File metadata
- Download URL: tidygraphtool-0.1.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
399cdbee9bd52ea6cd889603e69ee5685793ce82af9cc5a3bd9a91c9331961bd
|
|
| MD5 |
fa861627116807233f9df358bf43c21f
|
|
| BLAKE2b-256 |
729f951dfce496da5594bfa03d7c7fb903140eef0c9179d0a5e579d14557ad0c
|
File details
Details for the file tidygraphtool-0.1-py3-none-any.whl.
File metadata
- Download URL: tidygraphtool-0.1-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68eec267e1f5f70eb46ee7110f478710893378a9113b353fbc20e71db0e3e336
|
|
| MD5 |
7cc2c329b4477d3d42610d7e5d580278
|
|
| BLAKE2b-256 |
441b9bb3f63118a3b64b8936a2f3973a98ffd922ca17a9fccd2eb1f1caf78f04
|