Metadata-Version: 2.1
Name: electrus
Version: 1.1.2
Summary: Electrus is a lightweight asynchronous & synchronous database module designed for Python.
Home-page: https://github.com/embrake/electrus
Author: Pawan kumar
Author-email: embrakeproject@gmail.com
Keywords: database,async,asynchronous,synchronous,fast,lightweight,json
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Electrus Database

Electrus is a lightweight asynchronous & synchronous database module designed for Python, providing essential functionalities for data storage and retrieval.

## Table of Contents

- [Overview](#overview)
- [Installation](#installation)
- [Getting Started](#getting-started)
- [Examples](#examples)
- [Documantation](#documantation)
- [Support](#support)
## Overview

Electrus offers functionalities to manage collections and perform various operations such as insertion, updates, deletion, and data querying.

## Installation

To install Electrus, use the following pip command:

```bash
$ pip install electrus
```

## Getting Started

`Asynchronous`

```python
import electrus.asynchronous as electrus

client = electrus.Electrus()
database = client['mydb'] # enter you desire database
collection = database['mycollection']
```

`Synchronous`

```python
import electrus.synchronous as electrus

client = electrus.Electrus()
database = client['mydb'] # enter you desire database
collection = database['mycollection']
```

## Examples

### `Asynchronous`

### Inserting data operation

```python
# save this as main.py

import asyncio

import electrus.asynchronous as electrus
from electrus.exception import ElectrusException

client = electrus.Electrus()
database = client['mydb']
collection = database['mycollection']

async def main():
  data = {
    "id": "$auto",
    "name": "Embrake | Electrus",
    "email": ["embrakeproject@gmail.com", "control@vvfin.in"],
    "role": "user"
  }

  try:
    query = await collection.insert_one(data)
    if query.success:
      print("Data inserted successfully!")
  except ElectrusException as e:
    print("Something went wrong {}".format(e))

if __name__ == "__main__":
  asyncio.run(main())

```
`run the script`
```bash
$ python main.py
```
### `Synchronous`

### Inserting data operation

```python
# save this as main.py

import electrus.synchronous as electrus
from electrus.exception import ElectrusException

client = electrus.Electrus()
database = client['mydb']
collection = database['mycollection']

data = {
  "id": "$auto",
  "name": "Embrake | Electrus",
  "email": ["embrakeproject@gmail.com", "control@vvfin.in"],
  "role": "user"
}

try:
  query = collection.insert_one(data)
  if query.success:
    print("Data inserted successfully!")
except ElectrusException as e:
  print("Something went wrong {}".format(e))

```
`run the script`
```bash
$ python main.py
```

## Documantation

The complete documantation available at [http://electrus.vvfin.in](http://electrus.vvfin.in).

## Support

For any help and support feel free to contact us at `embrakeproject@gmail.com` or `control@vvfin.in`
