Skip to main content

Electrus is a lightweight asynchronous & synchronous database module designed for Python.

Project description

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

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:

$ pip install electrus

Getting Started

Asynchronous

import electrus.asynchronous as electrus

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

Synchronous

import electrus.synchronous as electrus

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

Examples

Asynchronous

Inserting data operation

# 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_inc",
    "name": "Embrake | Electrus",
    "email": ["embrakeproject@gmail.com", "control@vvfin.in"],
    "role": "user"
  }

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

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

run the script

$ python main.py

Synchronous

Inserting data operation

# 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_inc",
  "name": "Embrake | Electrus",
  "email": ["embrakeproject@gmail.com", "control@vvfin.in"],
  "role": "user"
}

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

run the script

$ python main.py

Documantation

The complete documantation available at http://electrus.vvfin.in.

Support

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

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

electrus-1.1.1.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

electrus-1.1.1-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file electrus-1.1.1.tar.gz.

File metadata

  • Download URL: electrus-1.1.1.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for electrus-1.1.1.tar.gz
Algorithm Hash digest
SHA256 c2f426ba4b42cba2aa54d3c465033b29e973b53d12807b163a45ee72f00741e2
MD5 8e5bc26b03f32b4107aad9c815ca3e67
BLAKE2b-256 1082370d93fd29e439c4f60e08a4b0e758149a524b74f874df5b9a7a0bd0be1d

See more details on using hashes here.

File details

Details for the file electrus-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: electrus-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for electrus-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4ff8a8de4b25286eed42c8645e513d94a08a1371b32510ec74b80d763815b7c6
MD5 703788b009df37b8c170583a27798b5d
BLAKE2b-256 ea8716651fafa6fe604dd32ba5b3264047f3ecc17496dc60c7dce5119e200d87

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