A client package for Firefly database
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="yourpassword")
# 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.3.0.tar.gz
(2.8 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.3.0.tar.gz.
File metadata
- Download URL: ifireflylib-0.3.0.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00f71323e141400e2cd419a9634a383b73aa34c356e59e05d5babb89a1b9e019
|
|
| MD5 |
a60032ea9a72a68032da783ed59300ce
|
|
| BLAKE2b-256 |
793f4bda731387624477a68c3377b07907199b52fde72599ed0029081bb65dbb
|
File details
Details for the file ifireflylib-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ifireflylib-0.3.0-py3-none-any.whl
- Upload date:
- Size: 2.8 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 |
93eeed910151bd12436f8eb4cf49a96d9df66268050fee791598e0d3db6dc1f8
|
|
| MD5 |
a159f4c0c12ca456f88335e633a7342c
|
|
| BLAKE2b-256 |
577218d7db82653fb21f763b3db585dfe98446c34099da45a2d8031a3a68fe26
|