# 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`
Raw data
{
"_id": null,
"home_page": "https://github.com/embrake/electrus",
"name": "electrus",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "database,async,asynchronous,synchronous,fast,lightweight,json",
"author": "Pawan kumar",
"author_email": "embrakeproject@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a9/c0/6c14f29217d4bc7b9703591902f27c986996ba732a3190acdd826ae30c9d/electrus-1.1.2.tar.gz",
"platform": null,
"description": "# Electrus Database\n\nElectrus is a lightweight asynchronous & synchronous database module designed for Python, providing essential functionalities for data storage and retrieval.\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n- [Examples](#examples)\n- [Documantation](#documantation)\n- [Support](#support)\n## Overview\n\nElectrus offers functionalities to manage collections and perform various operations such as insertion, updates, deletion, and data querying.\n\n## Installation\n\nTo install Electrus, use the following pip command:\n\n```bash\n$ pip install electrus\n```\n\n## Getting Started\n\n`Asynchronous`\n\n```python\nimport electrus.asynchronous as electrus\n\nclient = electrus.Electrus()\ndatabase = client['mydb'] # enter you desire database\ncollection = database['mycollection']\n```\n\n`Synchronous`\n\n```python\nimport electrus.synchronous as electrus\n\nclient = electrus.Electrus()\ndatabase = client['mydb'] # enter you desire database\ncollection = database['mycollection']\n```\n\n## Examples\n\n### `Asynchronous`\n\n### Inserting data operation\n\n```python\n# save this as main.py\n\nimport asyncio\n\nimport electrus.asynchronous as electrus\nfrom electrus.exception import ElectrusException\n\nclient = electrus.Electrus()\ndatabase = client['mydb']\ncollection = database['mycollection']\n\nasync def main():\n data = {\n \"id\": \"$auto\",\n \"name\": \"Embrake | Electrus\",\n \"email\": [\"embrakeproject@gmail.com\", \"control@vvfin.in\"],\n \"role\": \"user\"\n }\n\n try:\n query = await collection.insert_one(data)\n if query.success:\n print(\"Data inserted successfully!\")\n except ElectrusException as e:\n print(\"Something went wrong {}\".format(e))\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n\n```\n`run the script`\n```bash\n$ python main.py\n```\n### `Synchronous`\n\n### Inserting data operation\n\n```python\n# save this as main.py\n\nimport electrus.synchronous as electrus\nfrom electrus.exception import ElectrusException\n\nclient = electrus.Electrus()\ndatabase = client['mydb']\ncollection = database['mycollection']\n\ndata = {\n \"id\": \"$auto\",\n \"name\": \"Embrake | Electrus\",\n \"email\": [\"embrakeproject@gmail.com\", \"control@vvfin.in\"],\n \"role\": \"user\"\n}\n\ntry:\n query = collection.insert_one(data)\n if query.success:\n print(\"Data inserted successfully!\")\nexcept ElectrusException as e:\n print(\"Something went wrong {}\".format(e))\n\n```\n`run the script`\n```bash\n$ python main.py\n```\n\n## Documantation\n\nThe complete documantation available at [http://electrus.vvfin.in](http://electrus.vvfin.in).\n\n## Support\n\nFor any help and support feel free to contact us at `embrakeproject@gmail.com` or `control@vvfin.in`\n",
"bugtrack_url": null,
"license": "",
"summary": "Electrus is a lightweight asynchronous & synchronous database module designed for Python.",
"version": "1.1.2",
"project_urls": {
"Homepage": "https://github.com/embrake/electrus"
},
"split_keywords": [
"database",
"async",
"asynchronous",
"synchronous",
"fast",
"lightweight",
"json"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d6b7dd7187d4410c9ce90c05e50d5cecfeeecb96e2979056748d072db8e2d4a0",
"md5": "3f71e83e1e1377c9ffa9d0d228594772",
"sha256": "1ad6e27c6c2349ee46430c62df5c549f1ee794dc31dc70796822a3021f7a20bf"
},
"downloads": -1,
"filename": "electrus-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3f71e83e1e1377c9ffa9d0d228594772",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 46443,
"upload_time": "2024-03-17T09:16:22",
"upload_time_iso_8601": "2024-03-17T09:16:22.055421Z",
"url": "https://files.pythonhosted.org/packages/d6/b7/dd7187d4410c9ce90c05e50d5cecfeeecb96e2979056748d072db8e2d4a0/electrus-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a9c06c14f29217d4bc7b9703591902f27c986996ba732a3190acdd826ae30c9d",
"md5": "5d1aae7fe518ce5faf9fc2983151df8a",
"sha256": "83b8882a26a39f2e81349fb966008dec2b07f4de3df3bb6963fa52fae31a0d9c"
},
"downloads": -1,
"filename": "electrus-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "5d1aae7fe518ce5faf9fc2983151df8a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 32937,
"upload_time": "2024-03-17T09:16:24",
"upload_time_iso_8601": "2024-03-17T09:16:24.612551Z",
"url": "https://files.pythonhosted.org/packages/a9/c0/6c14f29217d4bc7b9703591902f27c986996ba732a3190acdd826ae30c9d/electrus-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-17 09:16:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "embrake",
"github_project": "electrus",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "electrus"
}