Skip to main content

Urd is a scheduler for Django projects. Some features:

  • schedule < 1m time slots

  • single concurrent execution [1]

  • fast enable/disable [2]

  • simple deployment

  • no extra dependencies beyond Django

Setup

  • Install urd pip install urd

  • Add urd to INSTALLED_APPS

  • Run manage.py migrate

  • Start the scheduler with manage.py monitor

Usage

  • Define a tasks.py module in the app that should have tasks.

  • Create a function like this:

@schedulable_task
def my_task(heartbeat):
    for foo in bar:
        heartbeat()
        do_some_task()

Calling heartbeat() regularly is important to make the task cancellable in a timely manner.

Now define a task in the iommi admin. It will be enabled pretty much as soon as you save.

Administration

Urd ships with integration for the iommi admin.

Why not cron/celery/django-q

  • Cron didn’t work for me because I need to execute a function more often than once a minute

  • Cron also doesn’t work for me because if you do once per minute, and the task takes two minutes, you get TWO executing processes of that task for a while. This can be disastrous for a few reasons, and can cause things to spiral out of control.

  • Celery/django-q are task queues, not schedulers. They have scheduler components, but they don’t have a way to ensure only one process at a time runs a specific task.

  • Django-q doesn’t allow schedules that execute more often than once per minute

  • Django-q caused me a lot of problems where the schedule seemed to put future items in the queue, and I couldn’t make it stop trying to execute them.

What does urd mean?

Urd (or Urðr, or Wyrd) is one of the Norns, the goddesses who weave the destiny of gods and humans.

Metadata

Release files for urd 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for urd 1.3.2
File Size Uploaded
urd-1.3.2.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for urd 1.3.2
File Interpreter ABI Platform
urd-1.3.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 31.3 kB

Release files / urd-1.3.2.tar.gz

Download URL urd-1.3.2.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
beb731a7ebeebaa86db5dbaad9bed75c1f8863276b9c4f35c27c363b688b0ccc
BLAKE2b-256 checksum
How to use checksums
e84f7daccd34e4fc1f896588ab16bb381272d10e0ce7e957327a79f6bfd1c31d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.11

Release files / urd-1.3.2-py2.py3-none-any.whl

Download URL urd-1.3.2-py2.py3-none-any.whl
Size 17.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ace4254fec6c44184677968fb50769c4a52b33086347c9088c5792d3ef386464
BLAKE2b-256 checksum
How to use checksums
66172ef1ffef68321a684c74ca5fa3179c9e6de5c2c051266ade2c8cc2fdbf8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.11

Release history Release notifications | RSS feed

This release

1.3.2 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release 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