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.5.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.5.tar.gz.
File metadata
- Download URL: ifireflylib-0.2.5.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 |
720eb06d40f8951f65e33da78b40de44eff6ff1f50cb014b7ef606861c026404
|
|
| MD5 |
88b72d89b4f136d9c066b167a36d7320
|
|
| BLAKE2b-256 |
ee8f06def4134af4d98c83540a389dfc81c99475abf9f12a809ece079e5eb73c
|
File details
Details for the file ifireflylib-0.2.5-py3-none-any.whl.
File metadata
- Download URL: ifireflylib-0.2.5-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 |
2ec98e1cb94e6e83f27c3ea5cd84f6db2fb3e8393a6b39584e0dd90c91c1e66a
|
|
| MD5 |
f1152643c0b4a2312c42d20a0393f63b
|
|
| BLAKE2b-256 |
bc67b1f3ef55e4d16d9a94f1dd2d7b680b4b06ed5f9897e8fc0bc52b2db7da6d
|