Skip to main content

Quart extension that provides scheduled background tasks

Project description

Build Status docs pypi python license

Quart-Tasks is a Quart extension that provides scheduled background tasks.

Quickstart

Quart-Tasks is used by associating it with an app and then registering scheduled tasks,

from quart import Quart
from quart_tasks import QuartTasks

app = Quart(__name__)
tasks = QuartTasks(app)

@tasks.cron("*/5 * * * *")  # every 5 minutes
async def infrequent_task():
    ...  # Do something

@tasks.cron(
    seconds="*1/0",  # every 10 seconds
    minutes="*",
    hours="*",
    day_of_month="*",
    month="*",
    day_of_week="*",
)
async def frequent_task():
    ...  # Do something

@tasks.periodic(timedelta(seconds=10))
async def regular_task():
    ...  # Do Something

Note: the non-standard cron format (for seconds) is as defined by croniter.

The tasks will then run in the background as the app itself runs or they can be run manually via the CLI quart run-tasks.

Contributing

Quart-Tasks is developed on GitHub. If you come across an issue, or have a feature request please open an issue. If you want to contribute a fix or the feature-implementation please do (typo fixes welcome), by proposing a merge request.

Testing

The best way to test Quart-Tasks is with Tox,

$ pip install tox
$ tox

this will check the code style and run the tests.

Help

The Quart-Tasks documentation is the best places to start, after that try searching stack overflow or ask for help on gitter. If you still can’t find an answer please open an issue.

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

quart_tasks-0.2.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

quart_tasks-0.2.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file quart_tasks-0.2.2.tar.gz.

File metadata

  • Download URL: quart_tasks-0.2.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for quart_tasks-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9dd09d24e47608cd28e75fd44b248b8e1421cc45b19115dc126fbf50ccdf39c9
MD5 d1932a761ed61fd23cb645a02c57a606
BLAKE2b-256 b3ffd3e52b88012bc47f54e75b3a5a0de537312dca46c0c1be4fa53e59e4a613

See more details on using hashes here.

File details

Details for the file quart_tasks-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: quart_tasks-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for quart_tasks-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fe36600d2ca05ee96eefed9688db0a746c447ee2f8f46c0070a912a7fa731e2
MD5 ee2afdfd39633859e962c5e02ca60fd3
BLAKE2b-256 1031c5e035f130845831155ca41011f915209f900174cc356e6ab4bd1a06abeb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page