Skip to main content

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

  1. Clone the repository:

    git clone https://gitea.innovativedevsolutions.org/IDSolutions/firefly.git
    cd firefly/ifireflylib
    
  2. Run the build script:

    python build.py
    

    This 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


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.3.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ifireflylib-0.2.3-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file ifireflylib-0.2.3.tar.gz.

File metadata

  • Download URL: ifireflylib-0.2.3.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

Hashes for ifireflylib-0.2.3.tar.gz
Algorithm Hash digest
SHA256 ec9fb49e7d213b13fdc3ebdeb73e8c859028d74bba3d0973689af9d6d883ab89
MD5 1617a9501a3f06cdfc7a4f00e02a3374
BLAKE2b-256 7678fc4d54db331dcfb17a3f783aaf4ba6232782be90ee33e4bcdb574bcb7d90

See more details on using hashes here.

File details

Details for the file ifireflylib-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: ifireflylib-0.2.3-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

Hashes for ifireflylib-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c5c737720043852ad3ecb8d29851a5065a44b47ca74ae24dba8c81e7adb0e497
MD5 fc90bc0bc730269fcb49f96a42ba2213
BLAKE2b-256 cde33fa6096ee82715ea39996f12d0a83f3ac789dd4f3beb5b1eaf482a6a632a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page