Skip to main content

Skedulord is a tool that automates scheduling and logging of jobs. It's a layer on top of cron. It's mainly meant for Python users but it can also be used for other tools launched from the command line.

If you're new, check out the getting started guide.

Installation

uv pip install skedulord

If you like to live dangerously, you can also install from GitHub for the latest commit.

uv pip install --upgrade "skedulord @ git+https://github.com/koaning/skedulord.git"

Usage

These are all the commands available:

> python -m skedulord
Usage: __main__.py [OPTIONS] COMMAND [ARGS]...

  SKEDULORD: helps with cronjobs and logs.

Options:
  --help  Show this message and exit.

Commands:
  schedule  Set (or reset) cron jobs based on config.
  add       Add a job to the schedule config file.
  run       Run a single command, which is logged by skedulord.
  history   Shows a table with job status.
  init      Initialize a starter .env, schedule.yml, and sqlite database.
  serve     Serves the Skedulord API (and webapp if built).
  wipe      Wipe the disk or schedule state.
  version   Show the version.

Docmentation

The docs are hosted on GitHub Pages and can be found here.

Demo

Let's say we've got this small python file.

# script.py
for i in range(5):
    print(f"i am at iteration {i}")

The idea here is that skedulord can run this and keep track of logs.

python -m skedulord run jobname1 "script.py" --retry 3 --wait 60
python -m skedulord run jobname2 "script.py" --retry 3 --wait 60

This will run the "python script.py" command as if you'd normally run it from the command line. The skedulord parts around it do some extra things though.

Logs

The main thing skedulord does is structure logs from your scripts. The logs are generated in a structured format so it's easy to find bugs. When we ran the skedulord run command we attached a jobname (aptly named "jobname") which will also be the name of the folder where logs can be found.

> tree ~/.skedulord/
/Users/vincent/.skedulord/
├── heartbeat.jsonl
├── jobname1
│   └── 2021-02-14T16:56:34.txt
└── jobname2
    └── 2021-02-14T16:56:35.txt

The logs themselves have a timestamp as the filename.

Mechanics

We've designed skedulord to also be able to rerun jobs if they fail. Hiccups are part of real life and sometimes we can make a job succeed by trying again 5 minutes later. This is why you can specify how many attempts you'd like the job to make by setting --retry. You can also specify the wait time between attempts via --wait.

Schedule

The nice thing about skedulord running from the command line is that you can schedule it via crontab too! The downside is that it can get complex. You'd need to ensure that the jobs have access to the correct virtual environments and this can become a drag.

To help out, skedulord can also configure cron for you by configuring a .yml file.

# schedule.yml
user: vincent
schedule:
    - name: ping
      command: /home/vincent/path/scripts/ping.py
      cron: "*/2 * * * *"
    - name: github issues downloader
      command: /full/path/to/cli.py --repo foobar --output /Users/vincent/data
      cron: "0 1 * * *"
    - name: github actions downloader
      command: /full/path/to/scrape.py --repo foobar --output /Users/vincent/data
      cron: "0 1 * * *"

Given a schedule like this, skedulord can schedule everything via;

python -m skedulord schedule schedule.yml

You can confirm yourself that all jobs are now scheduled to run, with skedulord taking care of all the logging.

crontab -e

Note that skedulord assumes commands are Python scripts and executes them via uv run python.

Templating

Schedule commands support a few runtime tokens that are rendered when a job starts:

  • {current_date} (ISO date)
  • {current_time} (ISO time)
  • {current_datetime} (ISO datetime)

Webapp

Skedulord ships a FastAPI backend and a React webapp. You can start the API via:

python -m skedulord serve

The frontend lives in webapp/ and can be run via npm install + npm run dev. If you run npm run build, the API will serve the built app from webapp/dist.

Metadata

Release files for skedulord 3.0.6

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

Source distribution (sdist)

Source distribution for skedulord 3.0.6
File Size Uploaded
skedulord-3.0.6.tar.gz 110.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skedulord 3.0.6
File Interpreter ABI Platform
skedulord-3.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 225.0 kB

Release files / skedulord-3.0.6.tar.gz

Download URL skedulord-3.0.6.tar.gz
Size 110.5 kB
Tags Source
SHA-256 checksum
How to use checksums
045ce8b2a6b954d0cd93bac5483b3837d9bd2d5dc222eae0138516e10a676375
BLAKE2b-256 checksum
How to use checksums
e4203b678796aa0e023beabc61eae7f0707886442c72d3b6a68f0591fe336989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / skedulord-3.0.6-py3-none-any.whl

Download URL skedulord-3.0.6-py3-none-any.whl
Size 114.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
635c4adb80e5354b6210418d97cac475d2a32d74682da466f30bfb9d38a7be2a
BLAKE2b-256 checksum
How to use checksums
de89a6ecf277a55ecadf83d2eb83192cd0349bf746293c617bf3e5c19b308b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

3.0.6 This release

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

1.0.6

2 release files

1.0.5

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

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.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