Skip to main content

A simple ORM for ResilientDB's key-value store.

Project description

ResDB-ORM

ResDB-ORM is a Python module designed to simplify interactions with ResilientDB's key-value store database by providing an Object-Relational Mapping (ORM) interface. This library allows developers to use basic CRUD functionalities with ease.

Prerequisites

Before using this repository, ensure that the following services are running:

  1. kv_server: This is the key-value store server that forms the backend for ResilientDB. Follow the instructions in the ResilientDB repository to set it up and start it.

  2. ResilientDB-GraphQL: This provides a GraphQL interface to interact with ResilientDB. Follow the instructions in the ResilientDB-GraphQL repository to set it up and start it.

Installation

Once the above services are running, follow the steps below to set up and use ResDB-ORM.

1. Clone this Repository

git clone https://github.com/ResilientEcosystem/ResDB-ORM.git
cd ResDB-ORM

2. Create and Activate a Virtual Environment

Set up a virtual environment to manage dependencies:

python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

Ensure that you have all necessary dependencies installed:

pip install -r requirements.txt

4. Configure config.yaml

Update the config.yaml file to point to the correct Crow endpoint. After running ResilientDB-GraphQL, you should see output similar to the following:

(2024-08-17 00:03:53) [INFO    ] Crow/1.0 server is running at <CROW_ENDPOINT> using 16 threads
(2024-08-17 00:03:53) [INFO    ] Call `app.loglevel(crow::LogLevel::Warning)` to hide Info level logs. 

Replace <CROW_ENDPOINT> in the config.yaml file with the actual endpoint URL from the above output.

5. Verify Installation

Run the provided test.py script to verify that everything is set up correctly:

python test.py

This script will perform basic operations to ensure that the connection to the ResilientDB instance is functional.

6. Import the Module in Your Own Code

You can now import and use the ResDBORM module in your own projects:

from resdb_orm.orm import ResDBORM

Initialize the ORM

orm = ResDBORM()

# Example usage: Create a new record
data = {"key": "value"}
record_id = orm.create(data)
print(f"Record created with ID: {record_id}")` 

Contributing

We welcome contributions to this project! Please feel free to submit pull requests, report issues, or suggest new features.

License

This project is licensed under the Apache License 2.0.

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

resdb-orm-1.0.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

resdb_orm-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file resdb-orm-1.0.0.tar.gz.

File metadata

  • Download URL: resdb-orm-1.0.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for resdb-orm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b26e0b51789acd8420ab11fbe6f7eed4c8361c4fcdbb9ca70342bea2d2be599a
MD5 74a6938a07cf5aabc55d5c84b0f889d8
BLAKE2b-256 200aa66dbd9c3889147a10b649f7e0e9af3cc0efc039371ec791adca09a5d6f3

See more details on using hashes here.

File details

Details for the file resdb_orm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: resdb_orm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for resdb_orm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c41fc96c14784770221ab9b5cd08929b17d238e8ae155f6ab50a7f0c6433f90e
MD5 935f29069ecbc6c438e72e5ba46d5eb7
BLAKE2b-256 f5909377124c3713eaa75539519291a79654d01d93731e76febe4175c27bceef

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