Collected data middleware for DB.
Project description
Dynamically schedule data aggregation ⚔️ 👁️ 🗄️
API agnostic data aggregation scheduler that automatically interacts with your interface class and sends responses to DB.
Dependencies
requests
schedule
pymongo
walrus
psutil
pytz
discord-logger
boto3
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://...',
MAX_STEEL_URL='https://5423csd3j.exe...',
ADMIN_COLLECTION='admin',
_WEBHOOK='https://discord.com/api/webhooks/...', # Discord webhook for logging
# AWS CONFIG
AWS_ACCESS_KEY_ID="asnwnwjsMANS...",
AWS_SECRET_ACCESS_KEY_ID="JASDWKkjndm$234/mkasd...",
AWS_REGION="us-east-2", # default
LOGGING_BUCKET='s3 bucket name for storing logs'
) # 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sallron-0.2.5rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 450d6f47ef1867778ee55a6ce788db27a20588382a7de4dc71f2f796426243bb |
|
MD5 | 0b2bdc8ddfb10e11c70488b3d4023336 |
|
BLAKE2b-256 | 8ef9e7c71357c03d602fe196c1462ec706ebefd90b5f36badb57b320cbf535a3 |