FireflyDB Python Client
A Python client library for the FireflyDB database.
Features
- Connect to FireflyDB servers
- String operations (get, set, delete)
- List operations (push, pop, range)
- Hash operations (hget, hset, hdel)
- Comprehensive error handling
- Logging support
Installation
Prerequisites
- Python 3.13 or higher
- FireflyDB server
Building from Source
Installing with pip
pip install ifireflylib
Usage
from ifireflylib import IFireflyClient
client = IFireflyClient(host="localhost", port=6379, password="yourpassword")
if client.ping():
print("Connected to Firefly server")
client.string_ops.string_set("greeting", "Hello, Firefly!")
value = client.string_ops.string_get("greeting")
print(f"Got 'greeting': {value}")
client.list_ops.list_right_push("fruits", "apple")
client.list_ops.list_right_push("fruits", "banana")
fruits = client.list_ops.list_range("fruits", 0, -1)
print(f"List 'fruits': {fruits}")
client.hash_ops.hash_set("user:1", "name", "John Doe")
name = client.hash_ops.hash_get("user:1", "name")
print(f"Got 'user:1.name': {name}")
client.string_ops.delete("greeting")
client.string_ops.delete("fruits")
client.string_ops.delete("user:1")
client.close()
License
MIT License