Skip to main content

parviraptor

Python Django MySQL 8.0 MySQL 8.4 MySQL 9.7

parviraptor is a Django app for managing queue-based jobs, both sequentially and in parallel.

This package provides

  • abstract base classes and factories for modelling Django Model based job queues

  • capabilities of supporting jobs' interdependencies

  • a management command for processing job queues

  • rudimentary Django views for monitoring and job queue statistics

Running tests

Tests and lints are covered by just test, you can separately lint using the command just lint.

Development

For developing parviraptor it is necessary to have nix 2.x and direnv 2.x installed as system-wide dependencies. nix must have enabled the features "nix command" and "flake support".

The development shell can be invoked by e.g. direnv exec . zsh. Executing this for the first time might require to run direnv allow. Shorthand commands, for example those mentioned in chapter "Running tests", can be enumerated using just --help.

In order to test whether the package would be built correctly, you can run python setup.py build in the development shell to inspect whether build/lib/parviraptor/ looks as expected.

Installation

Just add 'parviraptor' to your INSTALLED_APPS Django setting as usual.

API outline

  • parviraptor.models.AbstractJobFactory is a factory generating job base classes. For details, see the class documentation itself. Also, you can spy into tests/models.py to see job class examples which have (or don't have) interdependencies.

  • parviraptor implements rudimentary views for monitoring (/queue-monitoring) and statistics (/open-queue-entries). You can reuse them by including the URLs by e.g.

      from django.urls import include, path
      urlpatterns = [
          # ...
          path("", include("parviraptor.urls")),
          # ...
      ]
    
    • /queue-monitoring: As a german IT department started implementing this functionality this endpoint serves "Alles OK" in case everything is fine. If there are failed, long unprocessed or long pending jobs, they are counted per queue and written down in english plain text.

    • /open-queue-entries serves a human-readable, styled table (in English) with open or pending job counts.

  • The management command process_queue starts a worker for processing a certain job queue. It internally manages each necessary job transition (e.g. PROCESSING -> FAILED). parviraptor supports so-called temporary job failures, i.e. if a "temporary exception" is raised, parviraptor resumes the job respecting the per-job configurable backoff strategy.

    • generic call: ./manage.py process_queue <app_label> <model>.
    • example: ./manage.py process_queue very_busy_app HeavyDutyJob
  • The management command clean_old_processed_jobs can be used for cleaning up stale job entries.

  • parviraptor.test provides a simple API for testing job queues. parviraptor.test.make_test_case_for_all_queues infers a test class which automatically covers all queues in your current codebase. You just need to derive from JobEntryFactory and provide an implementation which covers creating concrete instances for each job class. For further details, see according class and function documentations.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parviraptor-4.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

parviraptor-4.1.0-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file parviraptor-4.1.0.tar.gz.

File metadata

  • Download URL: parviraptor-4.1.0.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for parviraptor-4.1.0.tar.gz
Algorithm Hash digest
SHA256 3247842a2bac7ff1f8bdaccfbc1cdbace3c0f5e42329c9d408f42bf992b89dfc
MD5 8ce48ec63e83f2dc7baf67b8ea4e1861
BLAKE2b-256 9899b9b46ca2893790ab82da067ecda4b0d79e932880f6aa652217f9d95b16fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for parviraptor-4.1.0.tar.gz:

Publisher: python-publish.yml on puzzleYOU/parviraptor

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

File details

Details for the file parviraptor-4.1.0-py3-none-any.whl.

File metadata

  • Download URL: parviraptor-4.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for parviraptor-4.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a4f800a7c693ffd89dce7fa6cf471d02eb1d99b1743a560d08904074f868525
MD5 91f8f30b09095c70cbfd8b030cb393e0
BLAKE2b-256 fccd58cd2ea3b2e5c09dc39b6f3b84d6597be12d2a46c81a6ec88218390c5c8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for parviraptor-4.1.0-py3-none-any.whl:

Publisher: python-publish.yml on puzzleYOU/parviraptor

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

Release history Release notifications | RSS feed

This release

4.1.0 This release

2 files

4.0.0

2 files

3.4.0

2 files

3.3.1

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.2.2

2 files

2.2.1

2 files

2.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page