$ pip install cogdb

Cog is a persistent embedded graph database implemented purely in Python. Torque is Cog's graph traversal language. Cog is ideal for Python applications that does not require a full featured database and can easily be used as a library within an application. It provides a quick and easy way to add peristance to your application without needing any addtional setup. Cog can be used interactively in an IPython environment like Jupyter notebooks.

Create a simple graph

              from cog.torque import Graph
              g = Graph("people")
              g.put("alice","follows","bob")
              g.put("bob","follows","fred")
              g.put("bob","status","cool_person")
              g.put("charlie","follows","bob")
              g.put("charlie","follows","dani")
              g.put("dani","follows","bob")
              g.put("dani","follows","greg")
              g.put("dani","status","cool_person")
              g.put("emily","follows","fred")
              g.put("fred","follows","greg")
              g.put("greg","status","cool_person")
                  
See who is following who and create a view of that network

    g.v().tag("from").out("follows").tag("to").view("follows").render()
          
View