Lightweight framework for executing periodic async and sync jobs in python
Project description
regta
Lightweight framework to create and execute periodic async and sync jobs on different processes, threads and event loop.
Core Features
-
Different Jobs - Create async, thread-based or process-based jobs depending on your goals.
-
Support different code styles - Create OOP styled or functional styled jobs. Regta also provide interface to reuse user's already written code.
-
CLI interface to work with jobs - Regta provide CLI tool to list and start available written jobs.
-
Logging - Redefine standard and define your own logging way.
Installation
Install using pip install regta
or poetry add regta
.
You can check if regta was installed correctly with the following
command regta --help
.
Example
To write async job use @regta.async_job()
decorator
# jobs/some_async_job.py
from datetime import timedelta
import regta
@regta.async_job(interval=timedelta(seconds=5))
async def my_basic_job():
return "Hello world! This is just a log message."
See more about different jobs types here.
Start Up
To start jobs use regta run
command:
$ regta run
> [1] jobs were found.
> jobs.some_async_job:my_basic_job - Hello world! This is just a log message.
. . .
See CLI reference here.
Full documentation and reference is available at regta.alinsky.tech
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.