A client package for FireFlyDB
Project description
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
-
Clone the repository:
git clone https://gitea.innovativedevsolutions.org/IDSolutions/firefly.git cd firefly/ifireflylib -
Run the build script:
python build.pyThis will:
- Check for the native library
- Build the Python package
- Optionally install the package in development mode
Installing with pip
pip install ifireflylib
Usage
from ifireflylib import IFireflyClient
# Create a client
client = IFireflyClient(host="localhost", port=6379, password="xyz123")
# Test the connection
if client.ping():
print("Connected to Firefly server")
# String operations
client.string_ops.string_set("greeting", "Hello, Firefly!")
value = client.string_ops.string_get("greeting")
print(f"Got 'greeting': {value}")
# List operations
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}")
# Hash operations
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}")
# Clean up
client.string_ops.delete("greeting")
client.string_ops.delete("fruits")
client.string_ops.delete("user:1")
# Close the connection
client.close()
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ifireflylib-0.2.4.tar.gz
(2.4 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ifireflylib-0.2.4.tar.gz.
File metadata
- Download URL: ifireflylib-0.2.4.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eb8c4c8730fbc6d2bf1b28e3f6a980e2a5ed7ee8e1732127795416cdcaca24e
|
|
| MD5 |
6f6369565411ee473d8d1b2bca774084
|
|
| BLAKE2b-256 |
2d5c418514a1d90808d0aa21c7e380d25103c663f323e8b87b5574ad66f5019d
|
File details
Details for the file ifireflylib-0.2.4-py3-none-any.whl.
File metadata
- Download URL: ifireflylib-0.2.4-py3-none-any.whl
- Upload date:
- Size: 2.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6045e33fde00940de77287384a3e1e2f8de3044c3727e4114ee53364b89ee4ca
|
|
| MD5 |
e9870402d2b678ecff5de6fde148f795
|
|
| BLAKE2b-256 |
d909e63655b48d214402390dec6cb01cf5d98ffeae240349ff2fe23c64045fe7
|