A wrapper around pygraphviz to implement an ubergraph
Project description
Ubergraph
This is a package used to wrap pygraphviz to create ubergraphs.
Ubergraphs are based upon the paper.
Importing ubergraph
from ubergraph import ubergraph
Functions
Create an ubergraph
You can create an ubergraph which is simply a directed graph in pygraphviz.
u = ubergraph.ubergraph()
Add a node to the ubergraph
You can add nodes to your ubergraph.
u = ubergraph.add_node(u, "node")
Add an edge to the ubergraph
You can add edges to your ubergraph. The lists may be empty. Any undefined nodes or edges will be added to the ubergraph.
u = ubergraph.add_edge(u, "edge", list_of_from_nodes, list_of_to_nodes, list_of_from_edges, list_of_to_edges)
Get the nodes in the ubergraph
You can get the nodes in your ubergraph.
nodes = ubergraph.get_nodes(u)
Get the edges in the ubergraph
You can get the edges in your ubergraph.
edges = ubergraph.get_edges(u)
MAY BE BUGGY: Get the nodes and edges from a node or edge
froms = get_from(u, node_or_edge)
MAY BE BUGGY: Get the nodes and edges to a node or edge
tos = get_to(u, node_or_edge)
MAY BE BUGGY: Get the edges that a node or edge is in
in_edges = get_in_edges(u, node_or_edge)
MAY BE BUGGY: Get the edges that is in a node or edge
out_edges = get_out_edges(u, node_or_edge)
View our ubergraph
Because our ubergraph, u, is a pygraphviz object we can view it by setting the layout (one of https://graphviz.org/docs/layouts/) and then drawing it:
u.layout("circo") # could be other layouts from https://graphviz.org/docs/layouts/
u.draw("filename.png")
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
File details
Details for the file ubergraph-0.0.2.tar.gz
.
File metadata
- Download URL: ubergraph-0.0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f28e76374708c93d6afe926a3f9f79611f79c5d748563c37df7dabc85681293 |
|
MD5 | 45803408750560d84fb4e82b5440b770 |
|
BLAKE2b-256 | 840d170d938f620ce4838d255c381e613e6a6f41522cd589e950f9360402641d |
File details
Details for the file ubergraph-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: ubergraph-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5e9348e6635926a5ef5c5d7c7d05877a346ab690737ac8f321a4b3fbe1fe439 |
|
MD5 | ee7966f4d2c3bcddf65cda5f27a78e6e |
|
BLAKE2b-256 | 40c7136e7969c8a01c5e7d8cf99ba7210781101aed41f362f70f7d2e9a82c9cb |