Collected data middleware for DB.


Keywords
sallron, sauron, data-middleware, data-aggregator, pymongo, schedule, walrus, automatic-control, data-aggregation, pip, pymongo-wrapper, python3, redis-server
License
Other
Install
pip install sallron==0.2.11

Documentation

sallron PyPI version fury.io PyPI pyversions

Dynamically schedule data aggregation ⚔️ 👁️ 🗄️

API agnostic data aggregation scheduler that automatically interacts with your interface class and sends responses to DB.

Dependencies

  • redis-server (running)
  • requests
  • schedule
  • pymongo
  • walrus

Setup

pip3 install sallron

DB Structure

To do

Usage

If you want a regular lifecycle, just run the following code:

import sallron
import ExampleInterface

sallron.configureye(MONGO_CONN_STR='mongodb+srv://...', ADMIN_COLLECTION='admin') # configure your MongoDB settings
sallron.ring_ruler(ExampleInterface, "my_interface")

Now, for auto-resets + notifications on exceptions/crashes, save the previous file as you normally would (i.e. runner.py) and create a new file (i.e. erunner.py):

from sallron import eternal_runner
from os.path import join, dirname

here = dirname(__file__)

if __name__ == "__main__":
    filename = "runner.py"
    filepath = join(here, filename)
    eternal_runner(filepath)

Then just:

python3 erunner.py

Configureye

Required settings:

  • MONGO_CONN_STR
  • ADMIN_COLLECTION

Available settings (= std_value):

  • OS = 'UBUNTU'
  • SAVE_LOGS = False
  • LOG_DIR = "logs/"
  • MAX_LOG_SIZE = 100000000 # 100Mb