🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

ouroboroslib

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ouroboroslib

A Graph Abstract Data Type

0.0.2
Maintainers
1

Ouroboroslib

A Graph Abstract Data Type Library. Named after the symbol of a serprent eating its own tail.

Installation

pip3 install ouroboroslib

Usage

from ouroboroslib import OuroborosGraph

ouroboros = OuroborosGraph(directed=True)
# Each tuple in the edge list is (starting_node, ending_node, edge_value)
ouroboros.overwrite_graph(edge_list=[(1, 2, 7), (2, 3, 10)])
ouroboros.add_node(4)
ouroboros.add_edge(3, 4, value=7)
ouroboros.delete_node(2)
# {(3, 4, 7)} - only 1 edge because node 2 is deleted
edges = ouroboros.tuple_edges()

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts