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. 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()
)
Features
- tidy and functional API for graph wranling with the graph-tool library.
Installation
Because that graph-tool is mostly a c++ library, tidygraphtool is best installed from anaconda in a fresh environment.
git clone https://github.com/jstonge/tidygraphtool.git
conda env create --file gt.yml
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
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.tar.gz.
File metadata
- Download URL: tidygraphtool-0.2.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 |
d03aaee8dc6f0ef011994ce1bd81f2f1538be3d961241e5d1cec33b5d756866c
|
|
| MD5 |
c98742e836d64e45807ce30f28a69e50
|
|
| BLAKE2b-256 |
ddc91911237f90c839e93608ce75711403dfe89c9c09d4129cc68577616c3fe7
|
File details
Details for the file tidygraphtool-0.2-py3-none-any.whl.
File metadata
- Download URL: tidygraphtool-0.2-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 |
031f9f2943769e9f3d65873114b190d4ef0915f98bb772284284180b9b9b16e5
|
|
| MD5 |
38259885aa90ee2f384251af204d8ff3
|
|
| BLAKE2b-256 |
d8e8e25d45136d439726fb9ec49597f2d59fe175244e8357817f60e09f1f2b19
|