resdb-orm


Nameresdb-orm JSON
Version 1.1.5 PyPI version JSON
download
home_pagehttps://github.com/ResilientEcosystem/ResDB-ORM
SummaryA simple ORM for ResilientDB's key-value store.
upload_time2024-11-15 01:30:35
maintainerNone
docs_urlNone
authorGopal Nambiar
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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](https://github.com/apache/incubator-resilientdb) 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](https://github.com/apache/incubator-resilientdb-graphql) 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:

```bash
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:

```bash
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

```bash
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:

```bash
python3 -m venv venv
source venv/bin/activate
```

### 3. Install Dependencies

Ensure that you have all necessary dependencies installed:

```bash
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:

```scss
(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:

```bash
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:

```python
from resdb_orm.orm import ResDBORM
```

# Initialize the ORM
```python
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.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ResilientEcosystem/ResDB-ORM",
    "name": "resdb-orm",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Gopal Nambiar",
    "author_email": "gnambiar@ucdavis.com",
    "download_url": "https://files.pythonhosted.org/packages/92/37/8c5ae53ba338ccf4199b07b70b303ee6cf92676bd8f0b3a8378a8d4072fd/resdb-orm-1.1.5.tar.gz",
    "platform": null,
    "description": "\n# ResDB-ORM\n\nResDB-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.\n\n## Prerequisites\n\nBefore using this repository, ensure that the following services are running:\n\n1. **kv_server**: This is the key-value store server that forms the backend for ResilientDB. Follow the instructions in the [ResilientDB repository](https://github.com/apache/incubator-resilientdb) to set it up and start it.\n\n2. **ResilientDB-GraphQL**: This provides a GraphQL interface to interact with ResilientDB. Follow the instructions in the [ResilientDB-GraphQL repository](https://github.com/apache/incubator-resilientdb-graphql) to set it up and start it.\n\n## Setting up Prerequisites\n\nYou 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.\n\nTo use the INSTALL.sh script:\n\n```bash\ngit clone https://github.com/ResilientEcosystem/ResDB-ORM.git\ncd ResDB-ORM\n./INSTALL.sh\n```\n\n## Installation\n\nResDB-ORM is also available on PyPI and can be installed using pip:\n\n```bash\npip install resdb-orm\n```\n\nOnce the above services are running, follow the steps below to set up and use ResDB-ORM.\n\n### 1. Clone this Repository\n\n```bash\ngit clone https://github.com/ResilientEcosystem/ResDB-ORM.git\ncd ResDB-ORM\n```\n\n**Note:** The script may require sudo privileges to install dependencies and set up services.\n\n### 2. Create and Activate a Virtual Environment\n\nSet up a virtual environment to manage dependencies:\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n### 3. Install Dependencies\n\nEnsure that you have all necessary dependencies installed:\n\n```bash\npip install -r requirements.txt\n```\n\n### 4. Configure  `config.yaml`\n\nUpdate the  `config.yaml`  file to point to the correct Crow endpoint. After running ResilientDB-GraphQL, you should see output similar to the following:\n\n```scss\n(2024-08-17 00:03:53) [INFO    ] Crow/1.0 server is running at <CROW_ENDPOINT> using 16 threads\n(2024-08-17 00:03:53) [INFO    ] Call `app.loglevel(crow::LogLevel::Warning)` to hide Info level logs. \n```\nReplace  `<CROW_ENDPOINT>`  in the  `config.yaml`  file with the actual endpoint URL from the above output.\n\n### 5. Verify Installation\n\nRun the provided  `test.py`  script to verify that everything is set up correctly:\n\n```bash\npython test.py\n```\nThis script will perform basic operations to ensure that the connection to the ResilientDB instance is functional.\n\n### 6. Import the Module in Your Own Code\n\nYou can now import and use the  `ResDBORM`  module in your own projects:\n\n```python\nfrom resdb_orm.orm import ResDBORM\n```\n\n# Initialize the ORM\n```python\norm = ResDBORM()\n\n# Example usage: Create a new record\ndata = {\"key\": \"value\"}\nrecord_id = orm.create(data)\nprint(f\"Record created with ID: {record_id}\")` \n```\n\n## Contributing\n\nWe welcome contributions to this project! Please feel free to submit pull requests, report issues, or suggest new features.\n\n## License\n\nThis project is licensed under the  Apache License 2.0.\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple ORM for ResilientDB's key-value store.",
    "version": "1.1.5",
    "project_urls": {
        "Homepage": "https://github.com/ResilientEcosystem/ResDB-ORM"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e82bb02669a47af1d2dd511475f853159cb0fbb172c68fe9d72d4bc7f3c35027",
                "md5": "b5a7f24ddd1468cb8b805908cd19b293",
                "sha256": "d617349ecb24e37636c46be9452fc1ea393660368ef3690b87b39d039dbd7d4b"
            },
            "downloads": -1,
            "filename": "resdb_orm-1.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b5a7f24ddd1468cb8b805908cd19b293",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7992,
            "upload_time": "2024-11-15T01:30:34",
            "upload_time_iso_8601": "2024-11-15T01:30:34.295703Z",
            "url": "https://files.pythonhosted.org/packages/e8/2b/b02669a47af1d2dd511475f853159cb0fbb172c68fe9d72d4bc7f3c35027/resdb_orm-1.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "92378c5ae53ba338ccf4199b07b70b303ee6cf92676bd8f0b3a8378a8d4072fd",
                "md5": "d26ae6b2f6fd02f333d56f22cbddb025",
                "sha256": "8ae3340cf6c40d7a63d76239f7155da1d5e4d8d6f87c1e838ca21b341734f6dd"
            },
            "downloads": -1,
            "filename": "resdb-orm-1.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "d26ae6b2f6fd02f333d56f22cbddb025",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7868,
            "upload_time": "2024-11-15T01:30:35",
            "upload_time_iso_8601": "2024-11-15T01:30:35.887622Z",
            "url": "https://files.pythonhosted.org/packages/92/37/8c5ae53ba338ccf4199b07b70b303ee6cf92676bd8f0b3a8378a8d4072fd/resdb-orm-1.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 01:30:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ResilientEcosystem",
    "github_project": "ResDB-ORM",
    "github_fetch_exception": true,
    "lcname": "resdb-orm"
}
        
Elapsed time: 0.37303s