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="*/10",  # 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.

To invoke a task immediately use the quart invoke-task [task_name] CLI command.

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.5.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

quart_tasks-0.5.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quart_tasks-0.5.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for quart_tasks-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c9023b26a054306bf5f50c6803bf86ae0ea46ca0eaa8efe6ec20f70880d38102
MD5 c5e3d547266569c1c015179097e0f0c7
BLAKE2b-256 60f5e337c24a493f59645a50102611cb6ccbf18dd016fecccc8dfd8bb78a446e

See more details on using hashes here.

Provenance

The following attestation bundles were made for quart_tasks-0.5.0.tar.gz:

Publisher: publish.yml on pgjones/quart-tasks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: quart_tasks-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for quart_tasks-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a202da2f434bee68057f3d58375cf25baab807c6242a806c8dad086537783ae9
MD5 1fae13100d0c0a4f390f9390accc88e7
BLAKE2b-256 118aaf879eedbf4d19edc0a2685f891f848ea87dad88d53518b40bb9d02c44bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for quart_tasks-0.5.0-py3-none-any.whl:

Publisher: publish.yml on pgjones/quart-tasks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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