Skip to main content

py-client

LokiDB python client SDK


Example

from random import randrange

from lokidb_sdk import Client

c = Client(
[
("localhost", 50051),
("localhost", 50052),
("localhost", 50053),
("localhost", 50054),
("localhost", 50055),
]
)

c.set("key", "value") # Will destribute keys evenly on db nodes
print(c.get("key"))

# Get all keys from all nodes
print(c.keys())

# Close connection to all nodes
c.close()

API

MethodInputOutput
Getkey (str)value (str)
Setkey (str), value (str)
Delkey(str)
Keyslist of keys (list[str])
Flush