cron-mon-py


Namecron-mon-py JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryA simple integration for CronMon
upload_time2024-10-21 22:12:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Static Badge](https://img.shields.io/badge/Python-3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)
![PyPI - Version](https://img.shields.io/pypi/v/cron-mon-py)
![Read the Docs](https://img.shields.io/readthedocs/cron-mon-py)

[![CI](https://github.com/cron-mon-io/cron-mon-py/actions/workflows/ci.yml/badge.svg)](https://github.com/cron-mon-io/cron-mon-py/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/cron-mon-io/cron-mon-py/graph/badge.svg?token=EBVN9A4223)](https://codecov.io/gh/cron-mon-io/cron-mon-py)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

# `cron-mon-py`

A simple Python package to make using [CronMon](https://github.com/cron-mon-io) 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

```console
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`.

```python
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`](https://docs.astral.sh/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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cron-mon-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/e5/66/e530befc31d8b9166086d2ffad4ed4b6c4fa88a9f1817c7e0603918b478b/cron_mon_py-0.2.1.tar.gz",
    "platform": null,
    "description": "![Static Badge](https://img.shields.io/badge/Python-3.9_%7C_3.10_%7C_3.11_%7C_3.12-blue?logo=python&logoColor=white)\n![PyPI - Version](https://img.shields.io/pypi/v/cron-mon-py)\n![Read the Docs](https://img.shields.io/readthedocs/cron-mon-py)\n\n[![CI](https://github.com/cron-mon-io/cron-mon-py/actions/workflows/ci.yml/badge.svg)](https://github.com/cron-mon-io/cron-mon-py/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/cron-mon-io/cron-mon-py/graph/badge.svg?token=EBVN9A4223)](https://codecov.io/gh/cron-mon-io/cron-mon-py)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n\n# `cron-mon-py`\n\nA simple Python package to make using [CronMon](https://github.com/cron-mon-io) in your cron jobs and scheduled tasks quick and easy.\n\n\n## Installation\n\n`cron-mon-py` can be installed via `pip` - or your Python package manager of choice - like any other Python package you might install\n\n```console\npip install cron-mon-py\n```\n\n## Example\n\nSimply 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:\n\n> 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`.\n\n```python\nfrom cron_mon import monitor\n\n# Replace <your-monitor-id> with your actual Monitor ID\n@monitor(\"<your-monitor-id>\")\ndef cron_job():\n    \"\"\"Your cron job code here\"\"\"\n    ...\n```\n\n## Development\n\n### Setting up a development environment\n\n`cron-mon-py` uses [`uv`](https://docs.astral.sh/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).\n\nOnce you have `uv` setup, you can use the `Makefile` provided to install all dependencies and run the tests. The available commands are as follows:\n\n* `install`: Install all of the required dependencies to work on `cron-mon-py`\n* `static-tests`: Run static tests via `ruff` and `mypy`\n* `unit-tests`: Run unit tests via `pytest`\n* `test`: Run all of the available tests for `cron-mon-py` (`static-tests` and `unit-tests`)\n* `build`: Build the package\n* `docs`: Build the package's docs\n* `serve-docs`: Serve the package's documentation with hot-reload\n* `format`: Autoformat the code with `ruff`*\n\n> *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.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple integration for CronMon",
    "version": "0.2.1",
    "project_urls": {
        "Documentation": "https://cron-mon-py.readthedocs.io",
        "Homepage": "https://github.com/cron-mon-io/cron-mon-py"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2083ce4a3f86a651aee4a2536312d7877e0ff1683d53617ab7cbc3db53007606",
                "md5": "90ff2bd0b3851f1c6e8213ec5eb2d707",
                "sha256": "8108c52116182aadde7953c36dd868ef7d0f70bb93322d221de2de41a377b006"
            },
            "downloads": -1,
            "filename": "cron_mon_py-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "90ff2bd0b3851f1c6e8213ec5eb2d707",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4348,
            "upload_time": "2024-10-21T22:12:35",
            "upload_time_iso_8601": "2024-10-21T22:12:35.757749Z",
            "url": "https://files.pythonhosted.org/packages/20/83/ce4a3f86a651aee4a2536312d7877e0ff1683d53617ab7cbc3db53007606/cron_mon_py-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e566e530befc31d8b9166086d2ffad4ed4b6c4fa88a9f1817c7e0603918b478b",
                "md5": "3dd5c65cf1fd9a03429ca881f49c210a",
                "sha256": "534ddb750a2ae41113ec1e00b302dd7af81c146bc93cf32dd4b702070bf7aeba"
            },
            "downloads": -1,
            "filename": "cron_mon_py-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3dd5c65cf1fd9a03429ca881f49c210a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 55200,
            "upload_time": "2024-10-21T22:12:37",
            "upload_time_iso_8601": "2024-10-21T22:12:37.304437Z",
            "url": "https://files.pythonhosted.org/packages/e5/66/e530befc31d8b9166086d2ffad4ed4b6c4fa88a9f1817c7e0603918b478b/cron_mon_py-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-21 22:12:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cron-mon-io",
    "github_project": "cron-mon-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cron-mon-py"
}
        
Elapsed time: 0.50018s