Skip to main content

Show schdueled jobs in a more readable way

Project description

Timetable for cronjobs

PyPI version

Show schdueled jobs in a more readable way.

screenshot

features

  • Easy configure - Setup job list in YAML format
  • Timezone supported - Able to configure server timezone and show the time in local time
  • Quick filtering - Allow customized label and quick lookup

Usage

  1. Install

    # basic
    pip install cron-times
    
    # with extra features
    pip install 'cron-times[cli]'
    
  2. Create task definition files

    Task definition are YAML files placed under tasks/ folder in current working directory.

    An example task:

    - name: task name
      schedule: "0 10 * * *"
      timezone: Asia/Taipei  # tzdata format; Would use UTC if not provided
      description: In the description, you *can* use `markdown`
      labels:
        - sample-label
        - another-label
    

    All *.yaml files would be loaded on initialization time. We could use scripts to pull the defines from other places before flask started.

  3. Run the app for testing

    flask --app cron_times run
    

Built-in providers

This tool comes with few builtin providers. The providers read cronjobs from the following places and build into task definition file:

  • crontab: Read crontab on local machine
  • dbt: Query scheduled jobs from dbt cloud. API triggered and manually triggered jobs are discarded.

To use the provider, you MUST install cron-times with [cli] option.

cron-times get-tasks <source> --help

We could run these providers before starting the app to refresh the definition files.

Deploy

Flask suggests to use a WSGI server for production. You can run the WSGI server app and call the module cron_times:app for such usage.

Take gunicorn as an example:

gunicorn --bind 0.0.0.0:8000 --workers 2 cron_times:app

Note

This app does not reload task definition after it started. You should restart the app in case task definition is changed.

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

cron_times-0.4.0.tar.gz (16.8 kB view hashes)

Uploaded Source

Built Distribution

cron_times-0.4.0-py3-none-any.whl (18.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page