Skip to main content

Taranis AI Scheduler

Project description

Scheduler Service

This service provides a scheduling system that interacts with a PostgreSQL backend to manage tasks. It supports adding, deleting, and viewing scheduled jobs via a Flask web interface, utilizing HTMX for dynamic updates. The service also includes special handling for debug mode, which displays a warning and disables job modification capabilities in production.

Features

  • Task Scheduling: View scheduled tasks with options to add and delete jobs in debug mode.
  • HTMX Integration: Dynamic updates to the job list without full page reloads.
  • Flask Web Interface: Clean and responsive user interface with job management.
  • Debug Mode Handling: Debug mode displays a warning and disables modification actions (add/delete).
  • Tailwind CSS: Modern and responsive UI styling.

Installation

It's recommended to use a uv to setup an virtual environment.

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv

Source venv and install dependencies

source .venv/bin/activate
uv pip install -Ue .[dev]

Development Setup

1. Download and Setup Tailwind CSS

We use Tailwind CSS for styling the frontend. First, download the Tailwind CSS CLI tool:

curl -sLo tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64
chmod +x tailwindcss

2. Start Tailwind CSS in Watch Mode

Run Tailwind CSS in watch mode to automatically build the CSS files as you modify the styles:

./tailwindcss -i scheduler/static/css/input.css -o scheduler/static/css/tailwind.css --watch

This will generate the tailwind.css file based on the input CSS and keep it updated as you develop.

3. Start Flask

Run the Flask development server:

flask run

This will start the Flask server and run the scheduler service at http://localhost:5000.


Usage

The job list shows all scheduled jobs, including their arguments, next run times, and triggers.

Debug Mode

Adding & Deleting Jobs

In debug mode, the interface allows you to add jobs by specifying the job name and interval (in seconds). These jobs are then stored in the PostgreSQL job store and managed by the APScheduler. Similarly, in debug mode, you can delete jobs from the interface using the delete buttons next to each job in the list.

When the service is running in debug mode, a warning banner will be displayed at the top of the page, and you will have access to the job add/delete functionality.

In production (when debug mode is off), job modification functionality will be hidden, and users cannot modify the schedule.


Configuration

Configuration is handled via environment variables.

Required Environment Variables

  • SQLALCHEMY_DATABASE_URI: The connection string to your PostgreSQL database.

    • Example: postgresql://username:password@localhost:5432/your_database
  • FLASK_ENV: Set to development or production.

    • Example: export FLASK_ENV=development
  • FLASK_APP: Set this to the name of your app (e.g., scheduler).

    • Example: export FLASK_APP=scheduler
  • JWT_SECRET_KEY: The secret key for signing JWT tokens.

    • Example: export JWT_SECRET_KEY=your-secret-key

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

taranis_scheduler-0.3.2.tar.gz (61.1 kB view details)

Uploaded Source

Built Distribution

taranis_scheduler-0.3.2-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file taranis_scheduler-0.3.2.tar.gz.

File metadata

  • Download URL: taranis_scheduler-0.3.2.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for taranis_scheduler-0.3.2.tar.gz
Algorithm Hash digest
SHA256 2ff01cc3f5dbb0b8305bfc4fa408e3e278417366d64f5927bda4f510f793d88a
MD5 1f4f81fffb1ca54a1a4351e3659af548
BLAKE2b-256 7c8d88be74cd45497506d29dec8af3ba0fa97342ea18e1c585c10714fbcc5d23

See more details on using hashes here.

File details

Details for the file taranis_scheduler-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for taranis_scheduler-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 815052f36577de8cb15611dabcca8e0204773aacaba74072255ee355db83baa0
MD5 d5566ac001c01a2272b3cec7b67ffdf9
BLAKE2b-256 8615b8c6524b5f77a8e7763a8835d21f1a665ef015e6e0705b6272bab800172f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page