Skip to main content

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

MODELS TO INTEGRATE

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


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)

Uploaded Source

Built Distribution

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

tidygraphtool-0.1-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

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

Hashes for tidygraphtool-0.1.tar.gz
Algorithm Hash digest
SHA256 399cdbee9bd52ea6cd889603e69ee5685793ce82af9cc5a3bd9a91c9331961bd
MD5 fa861627116807233f9df358bf43c21f
BLAKE2b-256 729f951dfce496da5594bfa03d7c7fb903140eef0c9179d0a5e579d14557ad0c

See more details on using hashes here.

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

Hashes for tidygraphtool-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68eec267e1f5f70eb46ee7110f478710893378a9113b353fbc20e71db0e3e336
MD5 7cc2c329b4477d3d42610d7e5d580278
BLAKE2b-256 441b9bb3f63118a3b64b8936a2f3973a98ffd922ca17a9fccd2eb1f1caf78f04

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