Skip to main content

jobman

Jobman automates the process of running and monitoring jobs on the command line. Jobman supports

  • running commands in the background immune to hangups
  • logging command output
  • retrying commands
  • aborting commands after timeout
  • delaying command execution for a specified time or event
  • sending notifications on command success or failure

Build Status codecov Docs site

Documentation

Visit the 📖 jobman documentation site 📖 for complete information on using jobman.

Requirements

Jobman runs on UNIX-like operating systems including Linux and MacOS. Windows is not supported.

Jobman requires Python3.9+.

Installation

Install or upgrade from PyPI with

$ pip install jobman

Example

The example below uses jobman to run a Python script train.py in the background and immune to hangups (e.g., a SIGHUP from an SHH timeout).

Jobman will ensure 60 seconds have passed and that the file data.csv exists before starting the program. If those conditions haven't been met by 5:00PM on March 5, 2032, jobman will abort the job.

Jobman will retry the program up to five times until there's one successful run, defined as an exit code of 0 or 42, waiting ten seconds between retries.

If the job succeeds, jobman will send a notification email. If the job fails, jobman will send an SMS message.

$ jobman \
    --wait-duration 60s --wait-for-file data.csv \
    --abort-time "2032-03-05T17:00:00" \
    --retry-attempts 5 --retry-delay 10s -c 0 -c 42  \
    --notify-on-job-success my-email --notify-on-job-failure my-cell \
    train.py
12e4b604

After submitting the train.py job above, use jobman show to display details on job progress:

jobman show 12e4b604

To view a running log of the consolidated stdout and stderr streams of the latest run of the job, use jobman logs:

jobman logs 12e4b604 --follow

Alternatives

Jobman aims to be reliable and fully-featured. It operates without requiring a system service/daemon for orchestration.

Alternative tools for similar use cases include:

  • cron: for scheduling repeated executions of a job
  • Airflow, Prefect, and Dagster: for managing dependencies between multiple jobs
  • supervisord: for daemon-based job management

Developing

Jobman uses pyenv for Python version management and poetry for builds. Before working on Jobman, ensure you have pyenv and poetry installed.

The Makefile defines targets for common operations during development, including the following:

  • make setup: set up and install the package
  • make fmt: run the autoformatters
  • make test: run the type tests and unit test suite
  • make build: build the jobman wheel

To release a new version of the package, use the bumpver.sh script. For example, to update to version 1.2.3, run ./bumpver.sh 1.2.3.

Contributing

Feature requests, bug reports, and pull requests are welcome! See CONTRIBUTING.md for details on how to contribute to jobman.

Metadata

Release files for jobman 0.4.0

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

Source distribution (sdist)

Source distribution for jobman 0.4.0
File Size Uploaded Provenance Actions
jobman-0.4.0.tar.gz 10.4 kB Without provenance Details for jobman-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 22.0 kB

Release files / jobman-0.4.0.tar.gz

Download URL jobman-0.4.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2cd4e0cda2cd43426a8eb75ba03736bb2cec2508148df9a683a0b4389b166b7b
BLAKE2b-256 checksum
How to use checksums
eddfaf9f82bbb6f8e4f672de0e82269f91fb607cbacedfe8aa2f05b2a73c2778
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-1041-azure

Release files / jobman-0.4.0-py3-none-any.whl

Download URL jobman-0.4.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
049072f3bccd3417211892a9d9de9d3c686a94ef0b9cad3b8d86f89b73a99026
BLAKE2b-256 checksum
How to use checksums
6a609ec4e529cff0f2f17e0cc69730d26e18a93b965a2a163b31f4fdc8817212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-1041-azure

Security for jobman 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

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