CronBark Python SDK & CLI — 크론잡 모니터링을 위한 간편 연동 도구
Project description
CronBark Python SDK
Python SDK and CLI for CronBark — monitor any cron job with a single decorator.
Preview / Alpha. This SDK is in preview and the CronBark SaaS service is launching soon. The public API may change in backwards-incompatible ways before the 1.0 release.
Install
pip install cronbark
Requires Python 3.9+.
Quickstart
Get an API token from your CronBark dashboard, then pick whichever style fits your job best.
1. Context manager
Wrap any block of code — start is sent on entry, and success or fail
(with the traceback) is sent on exit.
import cronbark
cronbark.configure(token="YOUR_TOKEN")
with cronbark.monitor():
run_backup()
2. Decorator
Instrument an existing function in one line.
import cronbark
@cronbark.job("YOUR_TOKEN")
def generate_report():
...
3. CLI — wrap any command
The easiest way to monitor an existing cron entry without touching its source:
cronbark exec --token YOUR_TOKEN "python backup.py"
Use it directly in crontab:
# Before
0 * * * * /usr/bin/python3 /opt/scripts/backup.py
# After
0 * * * * cronbark exec --token YOUR_TOKEN "/usr/bin/python3 /opt/scripts/backup.py"
The CLI captures stdout/stderr, forwards them to CronBark, and exits with the same status code as the wrapped command.
Configuration
The SDK reads configuration from environment variables by default:
| Variable | Purpose | Default |
|---|---|---|
CRONBARK_TOKEN |
Your job's API token | (none — required) |
CRONBARK_URL |
API base URL override (self-hosted, staging, etc.) | https://api.cronbark.com |
You can also configure the SDK programmatically:
import cronbark
cronbark.configure(
token="YOUR_TOKEN",
base_url="https://api.cronbark.com", # optional
timeout=10, # seconds, optional
)
Public API
Top-level functions exported from the cronbark package:
| Symbol | Description |
|---|---|
configure(token, base_url, timeout) |
Set global SDK configuration. |
monitor(token=None) |
Context manager — auto start / success / fail. |
job(token=None) |
Decorator wrapping a function with monitor. |
ping(token=None) |
One-shot start + success. |
start(token=None) |
Report execution start. |
success(token=None, output=None, metrics=None) |
Report success. |
fail(token=None, error_message=None, output=None) |
Report failure. |
tick(token=None) |
Heartbeat — report success without a prior start. |
CLI commands (cronbark --help):
cronbark exec --token TOKEN "<command>" # wrap and run a command
cronbark ping TOKEN # one-shot start+success
cronbark start TOKEN
cronbark success TOKEN
cronbark fail TOKEN --msg "..."
cronbark tick TOKEN
cronbark discover # scan local crontab
All HTTP calls are best-effort: network errors are swallowed and returned as
{"status": "error", "message": "..."} so an unreachable monitoring service
will never break your job.
Links
- Website: cronbark.com
- Documentation: docs.cronbark.com
- Issues: github.com/wookja-0/cronbark-sdk/issues
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cronbark-0.1.0.tar.gz.
File metadata
- Download URL: cronbark-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4b0030fe6e89850678b3eaa2fe7c86c92f8f29914522a7174fd204041014e9c
|
|
| MD5 |
9c30ca3f8bb7890447a8c5b77621ec9d
|
|
| BLAKE2b-256 |
f8611f7361f0327e12ea34b2712f97b86f2821336ea799d5113fcd4846a5b131
|
Provenance
The following attestation bundles were made for cronbark-0.1.0.tar.gz:
Publisher:
release.yml on wookja-0/cronbark-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cronbark-0.1.0.tar.gz -
Subject digest:
f4b0030fe6e89850678b3eaa2fe7c86c92f8f29914522a7174fd204041014e9c - Sigstore transparency entry: 1581212021
- Sigstore integration time:
-
Permalink:
wookja-0/cronbark-sdk@9e5fbaef1188b57fefd16c72bcb6974951cb7eae -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wookja-0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9e5fbaef1188b57fefd16c72bcb6974951cb7eae -
Trigger Event:
push
-
Statement type:
File details
Details for the file cronbark-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cronbark-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e9b5de47fb8a20bcda899a54f8dccd12a63780c0c058ccf0bf02294b86181be
|
|
| MD5 |
b0a3d375bd1702e51b45e59e6ba2c3bb
|
|
| BLAKE2b-256 |
84da0a529dd8ad3d15495d729c9ee9eec9c045ac25dec2ad5c0642c0fc5ae3ba
|
Provenance
The following attestation bundles were made for cronbark-0.1.0-py3-none-any.whl:
Publisher:
release.yml on wookja-0/cronbark-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cronbark-0.1.0-py3-none-any.whl -
Subject digest:
0e9b5de47fb8a20bcda899a54f8dccd12a63780c0c058ccf0bf02294b86181be - Sigstore transparency entry: 1581212103
- Sigstore integration time:
-
Permalink:
wookja-0/cronbark-sdk@9e5fbaef1188b57fefd16c72bcb6974951cb7eae -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wookja-0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9e5fbaef1188b57fefd16c72bcb6974951cb7eae -
Trigger Event:
push
-
Statement type: