CLI endpoint to handle (ASP encoded) graphs
Project description
# Grasp
Graph with ASP made easy.
## Use cases
### Write an ASP graph into gexf
grasp convert data.lp target.gexf
### Extract the biggest cc, write it anonymized in gml
grasp split data.lp --biggest-first "data_cc.lp" --slice 0 1
grasp convert data_cc_1.lp target.gml --anonymized
### Generate a small world graph in gml
grasp generate data.gml erdos_renyi_graph n=100 p=0.01
## Packaging
pip install graph-asp
Will also populate your env with the executable `grasp`,
enabling access to the CLI.
Note that the package *grasp* exists, but is unrelated to this work.
## CLI commands
CLI provides access to higher level [routines](grasp/routines.py).
- `split`: split by connected component.
- `info`: give info about given graph.
- `convert`: rewrite, anonymize or convert the graph to (clean) ASP or standard format.
- `generate`: generate a graph using a given generation method.
<!-- - `compress`: produce the powergraph compression of given graph as a bubble file -->
<!-- - ``: -->
### Other examples
# split a graph by cc
python -m grasp split data.lp -o "data_{}.lp"
# get infos
python -m grasp infos data.lp --graph-properties
# there is a shitload of options
python -m grasp infos --help
# conversions between formats
python -m grasp convert data.lp data.gml --anonymize
# generation of new graphs to play with
python -m grasp generate graph.gml powerlaw_cluster_graph n=5 m=2 p=0.01
Graph with ASP made easy.
## Use cases
### Write an ASP graph into gexf
grasp convert data.lp target.gexf
### Extract the biggest cc, write it anonymized in gml
grasp split data.lp --biggest-first "data_cc.lp" --slice 0 1
grasp convert data_cc_1.lp target.gml --anonymized
### Generate a small world graph in gml
grasp generate data.gml erdos_renyi_graph n=100 p=0.01
## Packaging
pip install graph-asp
Will also populate your env with the executable `grasp`,
enabling access to the CLI.
Note that the package *grasp* exists, but is unrelated to this work.
## CLI commands
CLI provides access to higher level [routines](grasp/routines.py).
- `split`: split by connected component.
- `info`: give info about given graph.
- `convert`: rewrite, anonymize or convert the graph to (clean) ASP or standard format.
- `generate`: generate a graph using a given generation method.
<!-- - `compress`: produce the powergraph compression of given graph as a bubble file -->
<!-- - ``: -->
### Other examples
# split a graph by cc
python -m grasp split data.lp -o "data_{}.lp"
# get infos
python -m grasp infos data.lp --graph-properties
# there is a shitload of options
python -m grasp infos --help
# conversions between formats
python -m grasp convert data.lp data.gml --anonymize
# generation of new graphs to play with
python -m grasp generate graph.gml powerlaw_cluster_graph n=5 m=2 p=0.01
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
graph-asp-0.0.8.tar.gz
(9.0 kB
view details)
File details
Details for the file graph-asp-0.0.8.tar.gz
.
File metadata
- Download URL: graph-asp-0.0.8.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdab9e9dbfbcffc94d31934b8f6e78aad3b28523902e13c084a9303cc7e2fee4 |
|
MD5 | 1e2cc2264b27f35f7c85b3493e1b87a3 |
|
BLAKE2b-256 | 5e48f6fda76ad2b903c88c1148843ae4b1e0d9c1ef95e2ad7e0b7dcfe26ae80c |