{"id":21082,"library":"cronitor","title":"Cronitor Python Client","description":"A lightweight Python client for Cronitor, providing monitoring and alerting for cron jobs, background jobs, and API endpoints. Current version 4.9.0, released May 2025. Active development with occasional minor releases.","status":"active","version":"4.9.0","language":"python","source_language":"en","source_url":"https://github.com/cronitorio/cronitor-python","tags":["monitoring","cron","cronitor","scheduling","alerts"],"install":[{"cmd":"pip install cronitor","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false}],"imports":[{"wrong":"from cronitor import Cronitor","symbol":"Monitor","correct":"from cronitor import Monitor"},{"symbol":"State","correct":"from cronitor import State"},{"symbol":"api_key","correct":"from cronitor import api_key"}],"quickstart":{"code":"import os\nfrom cronitor import Cronitor\n\napi_key = os.environ.get('CRONITOR_API_KEY', '')\nif not api_key:\n    raise ValueError('CRONITOR_API_KEY environment variable not set')\n\ncronitor = Cronitor(api_key=api_key)\n\n# Create a monitor\nmonitor = cronitor.monitors.create(name='My Job', schedule='*/5 * * * *')\n\n# Ping the monitor\ncronitor.ping(monitor.key, state='run')\nprint('Job started.')","lang":"python","description":"Initialize the client with your API key, create a monitor, and send a run ping."},"warnings":[{"fix":"Use `cronitor.monitors.create(name, schedule)` instead of direct methods on the Cronitor class.","message":"In v4.0, the client was rewritten. The old import pattern `from cronitor import Cronitor` still works, but the API for creating monitors changed: use `cronitor.monitors.create()` instead of `Cronitor(api_key).create_monitor()`.","severity":"breaking","affected_versions":">=4.0.0,<5.0.0"},{"fix":"Set CRONITOR_API_KEY environment variable or pass `api_key` argument to Cronitor() constructor.","message":"API key must be set via environment variable or passed explicitly. The client does not auto-read from .env files.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from cronitor import ping` and call `ping(monitor_key, state='...')` instead of `cronitor.pings.create(...)`.","message":"The `pings.create()` method is deprecated in favor of the module-level `ping()` function.","severity":"deprecated","affected_versions":">=4.5.0"}],"env_vars":null,"search_vec":"'2025':27 '4.9.0':24 'activ':28 'alert':13,38 'api':20 'background':17 'client':3,7 'cron':15,35 'cronitor':1,9,36 'current':22 'develop':29 'endpoint':21 'job':16,18 'lightweight':5 'may':26 'minor':32 'monitor':11,34 'occasion':31 'provid':10 'python':2,6 'releas':25,33 'schedul':37 'version':23","created_at":"2026-04-27T16:58:00.356224+00:00","updated_at":"2026-04-27T16:58:00.356224+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.9.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://cronitor.io","github":"https://github.com/cronitorio/cronitor-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/cronitor/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","observability"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}