Python client for interacting with FalkorDB database
Actively maintained. Last release 3 weeks ago, commits in 13 of the last 26 weeks. A safe choice.
pip install falkordbfalkordb-py
FalkorDB Python client
see docs
Installation
pip install FalkorDB
For faster parsing of large results (for example vector properties), install the
optional hiredis parser. redis uses it automatically:
pip install "FalkorDB[hiredis]"
Usage
Run FalkorDB instance
Docker:
docker run --rm -p 6379:6379 falkordb/falkordb
Or use FalkorDB Cloud
Synchronous Example
from falkordb import FalkorDB
# Connect to FalkorDB
db = FalkorDB(host="localhost", port=6379)
# Select the social graph
g = db.select_graph("social")
# Create 100 nodes and return a handful
nodes = g.query(
"UNWIND range(0, 100) AS i CREATE (n {v:1}) RETURN n LIMIT 10"
).result_set
for n in nodes:
print(n)
# Read-only query the graph for the first 10 nodes
nodes = g.ro_query("MATCH (n) RETURN n LIMIT 10").result_set
# Copy the Graph
copy_graph = g.copy("social_copy")
# Delete the Graph
g.delete()