Skip to main content

A simple integration for CronMon

Project description

Static Badge PyPI - Version Read the Docs

CI codecov Ruff Code style: black Checked with mypy

cron-mon-py

A simple Python package to make using CronMon in your cron jobs and scheduled tasks quick and easy.

Installation

cron-mon-py can be installed via pip - or your Python package manager of choice - like any other Python package you might install

pip install cron-mon-py

Example

Simply import the monitor decorator and use it on any function that serves as the entry point to your cron job/ scheduled task that you wish to monitor:

You'll need to have setup a Monitor and an API key within CronMon itself, and have exposed the API key in an environment variable called CRON_MON_API_KEY.

from cron_mon import monitor

# Replace <your-monitor-id> with your actual Monitor ID
@monitor("<your-monitor-id>")
def cron_job():
    """Your cron job code here"""
    ...

Development

Setting up a development environment

cron-mon-py uses uv to manage dependencies, so you'll need uv installed to get setup to work on cron-mon-py. You can either install uv on your machine, or you can use the dev container provided in the repository if your IDE supports dev containers (hint: it's very well supported on Visual Studio Code).

Once you have uv setup, you can use the Makefile provided to install all dependencies and run the tests. The available commands are as follows:

  • install: Install all of the required dependencies to work on cron-mon-py
  • static-tests: Run static tests via ruff and mypy
  • unit-tests: Run unit tests via pytest
  • test: Run all of the available tests for cron-mon-py (static-tests and unit-tests)
  • build: Build the package
  • docs: Build the package's docs
  • serve-docs: Serve the package's documentation with hot-reload
  • format: Autoformat the code with ruff*

*You can avoid having to use make format if you setup your IDE to autoformat on save. The provided dev container has this already setup for you.

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_mon_py-0.2.1.tar.gz (55.2 kB view details)

Uploaded Source

Built Distribution

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

cron_mon_py-0.2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file cron_mon_py-0.2.1.tar.gz.

File metadata

  • Download URL: cron_mon_py-0.2.1.tar.gz
  • Upload date:
  • Size: 55.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.4.25

File hashes

Hashes for cron_mon_py-0.2.1.tar.gz
Algorithm Hash digest
SHA256 534ddb750a2ae41113ec1e00b302dd7af81c146bc93cf32dd4b702070bf7aeba
MD5 3dd5c65cf1fd9a03429ca881f49c210a
BLAKE2b-256 e566e530befc31d8b9166086d2ffad4ed4b6c4fa88a9f1817c7e0603918b478b

See more details on using hashes here.

File details

Details for the file cron_mon_py-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cron_mon_py-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8108c52116182aadde7953c36dd868ef7d0f70bb93322d221de2de41a377b006
MD5 90ff2bd0b3851f1c6e8213ec5eb2d707
BLAKE2b-256 2083ce4a3f86a651aee4a2536312d7877e0ff1683d53617ab7cbc3db53007606

See more details on using hashes here.

Supported by

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