Code Monkey home page Code Monkey logo

flydb-sdk-python's Introduction

FlyDB-logo

FlyDB's github address: https://github.com/ByteStorage/FlyDB

English | δΈ­ζ–‡

FlyDB-SDK-Python

FlyDB-SDK-Python is a software development toolkit (SDK) for interacting with the FlyDB key-value database in Python.

FlyDB is a high-performance, lightweight key-value database, and with this SDK, you can easily use FlyDB to store and retrieve data in Python.

Installation

To use FlyDB-SDK-Python, you first need to install the FlyDB server and ensure it is running.

You can install FlyDB-SDK-Python using pip, by running the following command:

pip install FlyDB==0.0.3

Quick Start

Here's a simple example showing how to use FlyDB-SDK-Python to connect to the FlyDB server and perform data storage and retrieval:

from pathlib import Path
from FlyDB import db

# Create a FlyDB2 client
db_client = db.FlyDB()

# Connect to the FlyDB2
path = Path.cwd().joinpath("data")
db_client.connect_option(str(path), 256 * 1024 * 1024, True)

# Set a key-value pair
db_client.set("key", "value", 0)

# Get the value of a key
value = db_client.get("key")
print(value)

# Delete a key-value pair
db_client.delete("key")

API ReferenceAPI

FlyDB-SDK-Python currently supports the following APIs:

set(key, value, expire): Stores a key-value pair in the database. The key should be a string, and the value can be a string, integer, float, boolean, or byte stream. The expire parameter represents the expiration time in milliseconds. When expire is set to 0, the data will never expire.

get(key): Retrieves the value of a specified key from the database. The return value type depends on the actual stored data type.

delete(key): Deletes the specified key-value pair from the database.

For more API reference and detailed usage, please refer to the official documentation or the SDK source code.

Contributions and Feedback

If you encounter any issues or have any suggestions, please feel free to raise them. We welcome contributions from the community. If you want to contribute to the FlyDB-SDK-Python project, please submit a Pull Request or contact our development team.

License

FlyDB-SDK-Python is licensed under the MIT License. For details, please refer to the LICENSE file.

Disclaimer

FlyDB-SDK-Python is the official Python SDK for the FlyDB project, maintained and supported by the FlyDB team. Thank you for using FlyDB-SDK-Python, and we hope it brings convenience to your data storage and retrieval tasks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.