Skip to main content

A Streamlit-based job scheduler with one-time and cron scheduling support

Project description

Streamlit Job Scheduler

A simple and interactive Streamlit-based UI to configure and manage scheduled jobs — either one-time or cron-based.

Features

  • One-time scheduling (date + time + minute)
  • Cron scheduling with flexible frequency (daily, weekly, monthly, etc.)
  • Multi-hour and multi-day support in a single cron expression
  • Human-readable cron descriptions
  • Pytest unit tests

Quick start

Install (editable during development) and run the Streamlit app:

pip install -e .
streamlit run -m streamlit_job_scheduler/ui.py

Or run directly (development):

python -m streamlit_job_scheduler/ui.py

🧩 Usage

pip install streamlit-job-scheduler

Programmatic usage

Primary UI entry is streamlit_job_scheduler.ui.job_scheduler. Signature:

Example (use inside a Streamlit session):

from streamlit_job_scheduler.ui import job_scheduler
from streamlit_job_scheduler.models import SchedulerConfig
from streamlit_job_scheduler.enums import ScheduleType

config = SchedulerConfig(schedule_type=ScheduleType.CRONJOB, schedule="*/10 * * * *")
job = job_scheduler(None, config=config)  # returns a ScheduleInfo when not using a callback

Returned object is a streamlit_job_scheduler.models.ScheduleInfo with .schedule_type and .schedule attributes.

Cron helpers

Example:

from streamlit_job_scheduler.scheduler import generate_cron_expr, describe_cron

expr = generate_cron_expr("Daily", hours=[9,17], minutes=[0,30])
print(expr)                 # -> "0,30 9,17 * * *"
print(describe_cron(expr))  # human readable description

Tests

Pytest tests cover scheduler logic and a smoke UI test harness.

Run tests:

pytest -q

Tests to review:

Development notes & gotchas

  • The package requires Streamlit (see setup.cfg and pyproject.toml).
  • The UI function is designed to be run inside a Streamlit app — running it outside Streamlit will not render widgets.
  • The UI function signature is job_scheduler(callback_func, config=None). When using programmatically prefer passing the config as the second positional argument or as a keyword (config=...) so the function can detect the callback and config correctly. See implementation: streamlit_job_scheduler.ui.job_scheduler
  • Cron parsing expects standard 5-field cron expressions (minute hour day month weekday). See: streamlit_job_scheduler.scheduler.is_valid_cron

Contributing

License

MIT — see LICENSE

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

streamlit_job_scheduler-0.0.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

streamlit_job_scheduler-0.0.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_job_scheduler-0.0.1.tar.gz.

File metadata

  • Download URL: streamlit_job_scheduler-0.0.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.11

File hashes

Hashes for streamlit_job_scheduler-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4a476a564c67f7059d78aee2b746c01f4a3d761f8a130cf4f89d384c7069dcb1
MD5 14b7770df562038c5ca38c85650f0138
BLAKE2b-256 b046a45fc26827c5563afd8c1fa85c7e33ea32f4f2e45f9f514a1bcf94e0a56d

See more details on using hashes here.

File details

Details for the file streamlit_job_scheduler-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_job_scheduler-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a0ddf7616faeb76be82932186daf5f485c61b6b34bd61e62041d27371c055d08
MD5 4bc567e8938cd5de96b43eddfe2cafd7
BLAKE2b-256 f247906f0b855eda66d096b4d25d7e28c0a7c73694520b9024bf8df5273292a7

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