Skip to main content

Background scheduler for Flask

Project description

Flask Scheduler

Flask Scheduler is a simple Flask extension that allows you to schedule tasks to run at specific times. It uses the APScheduler library to schedule tasks.

Installation

Install Flask Scheduler using pip:

pip install Flask-Scheduler

Usage

To use Flask Scheduler, import the extension and initialize it with your Flask app:

from flask import Flask
from flask_scheduler import Scheduler

app = Flask(__name__)

# Initialize the extension
scheduler = Scheduler(app)

# scheduler config interval
app.config['SCHEDULER_API_INTERVAL'] = 5 # in seconds

@scheduler.runner()
def my_task():
    print('hi im running every 5 seconds')

# if you have separate task, and you don't want to run it every 5 seconds
# you can use interval argument in decorator
@scheduler.runner(interval=10)
def my_task1():
    print('hi im running every 10 seconds')

Contributing

Contributions are welcome! Please submit a pull request.

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

Flask-Scheduler-0.0.51.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

Flask_Scheduler-0.0.51-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file Flask-Scheduler-0.0.51.tar.gz.

File metadata

  • Download URL: Flask-Scheduler-0.0.51.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for Flask-Scheduler-0.0.51.tar.gz
Algorithm Hash digest
SHA256 25ff9abf55e14ccdddc13099d08de61dbffac65c7c911a5889942c5e9bb01d94
MD5 75838b5f48982f4de2d52a66db59bb7a
BLAKE2b-256 b31a08dd846cad2c84ef2bcf093999c3598a454a608e54c40099b9887addd869

See more details on using hashes here.

File details

Details for the file Flask_Scheduler-0.0.51-py3-none-any.whl.

File metadata

File hashes

Hashes for Flask_Scheduler-0.0.51-py3-none-any.whl
Algorithm Hash digest
SHA256 fd9d91abc2d254bde20ae6ae3faa58ee2a93b58a51ac4a523a2d8aa37ac6424f
MD5 c4064edb71338801626a1d7562f07dc0
BLAKE2b-256 ffe881d726971cd5ec0e3194e7fe7f6a67b57bee3ac77dace300f30885d84286

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