| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
steadycron is the official Python code-monitoring SDK for SteadyCron.
Wrap your scheduled jobs with @steadycron.job and SteadyCron will:
The monitor must already exist — create it in the Dashboard, via YAML manifest, or Terraform. The SDK never creates monitors. For a fully code-driven workflow, declare the monitor in your Terraform configuration or YAML manifest and reference it from your application by key: the cron schedule, alert rules, and SDK instrumentation all live in the same repository.
pip install steadycronNo runtime dependencies — uses Python's standard library only.
import steadycron
steadycron.api_key = "sc_ro_..." # read-only key; or set STEADYCRON_API_KEY env var
@steadycron.job("nightly-db-backup")
def backup():
run_backup() # start on entry, success on return, fail (+re-raise) on exceptionwith steadycron.monitor("nightly-db-backup"):
run_backup()m = steadycron.Monitor("nightly-db-backup")
m.ping() # bare success heartbeat
m.ping(state="start")
m.ping(state="fail", message="disk full")The SDK uses a read-only API key to resolve monitor keys to ping tokens at startup. Create one in:
SteadyCron Dashboard → Settings → API keys → New key → Scope: Read-only
Set it via:
import steadycron
steadycron.configure(
api_key="sc_ro_...",
environment="production", # optional — sent on every ping
capture_errors=True, # include exception message on fail pings (default False)
ping_timeout=5.0, # seconds (default 5)
resolve_cache_ttl=3600.0, # seconds (default 3600 = 1 hour)
)| Setting | Default | Env var fallback |
|---|---|---|
| api_key | None | STEADYCRON_API_KEY |
| api_url | https://api.steadycron.com | STEADYCRON_API_URL |
| ping_url | https://ping.steadycron.com | STEADYCRON_PING_URL |
| environment | None | STEADYCRON_ENVIRONMENT |
| capture_errors | False | — |
| ping_timeout | 5.0 s | — |
| resolve_cache_ttl | 3600.0 s | — |
If you cannot use API key resolution (e.g. air-gapped environments), set the ping token directly:
steadycron.monitors = {"nightly-db-backup": "hRkmWz8oZtlMFzvTAUdnRE"}The token is visible via Job detail → Code monitoring → Reveal ping token in the Dashboard.
MIT
| Back | FazBrowse Home | New Git URL |