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:
-
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.
-
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.
Setting up Prerequisites
You can use the provided INSTALL.sh script to automatically install and set up both the kv_server and ResilientDB-GraphQL services. The script will clone the necessary repositories, build the services, and start them.
To use the INSTALL.sh script:
git clone https://github.com/ResilientEcosystem/ResDB-ORM.git
cd ResDB-ORM
./INSTALL.sh
Installation
ResDB-ORM is also available on PyPI and can be installed using pip:
pip install resdb-orm
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
Note: The script may require sudo privileges to install dependencies and set up services.
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.
Metadata
Release files for resdb-orm 1.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| resdb-orm-1.1.5.tar.gz | 7.9 kB | Without provenance | Details for resdb-orm-1.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| resdb_orm-1.1.5-py3-none-any.whl | Python 3 | none | any | Details for resdb_orm-1.1.5-py3-none-any.whl |
Total release size: 15.9 kB
Release files / resdb-orm-1.1.5.tar.gz
| Download URL | resdb-orm-1.1.5.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ae3340cf6c40d7a63d76239f7155da1d5e4d8d6f87c1e838ca21b341734f6dd
|
|
BLAKE2b-256 checksum How to use checksums |
92378c5ae53ba338ccf4199b07b70b303ee6cf92676bd8f0b3a8378a8d4072fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / resdb_orm-1.1.5-py3-none-any.whl
| Download URL | resdb_orm-1.1.5-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d617349ecb24e37636c46be9452fc1ea393660368ef3690b87b39d039dbd7d4b
|
|
BLAKE2b-256 checksum How to use checksums |
e82bb02669a47af1d2dd511475f853159cb0fbb172c68fe9d72d4bc7f3c35027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for resdb-orm 1.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.