Skip to content

30-second quickstart

The fastest possible taste of NamiDB. Ephemeral, in-process, no setup.

Install

Terminal window
pip install namidb

Hello, graph

import namidb as tg
client = tg.Client("memory://acme")
client.cypher("CREATE (a:Person {name: 'Alice'})")
client.cypher("CREATE (b:Person {name: 'Bob'})")
client.cypher(
"MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'}) "
"CREATE (a)-[:KNOWS {since: 2020}]->(b)"
)
result = client.cypher("MATCH (p:Person) RETURN p.name AS name")
print(result.rows())
# [{'name': 'Alice'}, {'name': 'Bob'}]

Make it persistent

Swap the URI. The same six lines of code work against any backend:

client = tg.Client("file:///var/lib/namidb?ns=prod")

Next steps