Skip to main content

A tool for working with real-time program schedules

Project description

Rhylthyme

๐Ÿ•’ rhylthyme (pronounced "realtime") is a JSON-based workflow language for describing and executing real-time event scheduling.


๐Ÿš€ Quick Start

American Breakfast Example

Here's a simple program that coordinates cooking eggs, bacon, and toast to finish at the same time:

# Navigate to the CLI runner directory
cd rhylthyme-cli-runner

# Validate the breakfast program
python -m rhylthyme_cli_runner.cli validate ../rhylthyme-examples/programs/breakfast_schedule.json

# Run the breakfast program
python -m rhylthyme_cli_runner.cli run ../rhylthyme-examples/programs/breakfast_schedule.json

๐Ÿ’ซ What is Rhylthyme?

Rhylthyme provides a structured way to define real-time programs (schedules) consisting of multiple parallel tracks with sequential steps. Originally designed for time-critical rat experiments, it now accommodates various scheduling scenarios:

  • ๐Ÿณ Food Production: Restaurant kitchens, bakery operations, meal coordination
  • ๐Ÿ”ฌ Laboratory Research: Experimental protocols, sample processing workflows
  • โœˆ๏ธ Operations Management: Airport scheduling, event planning, logistics
  • ๐Ÿญ Manufacturing: Assembly lines, quality control, batch processing
  • ๐ŸŽฌ Media Production: Film scheduling, broadcast coordination

๐ŸŽฏ Key Features

  • Multi-track Execution: Run multiple parallel tracks of operations
  • Resource Constraints: Enforce equipment/station availability limits
  • Actor Constraints: Track and limit human attention/involvement
  • Rich Start Triggers: Time-based, dependency-based, or manual triggers
  • Buffer Support: Pre/post-step buffers with runtime extension capability
  • Variable Durations: Fixed, variable, or indefinite step durations
  • Interactive Control: Manual triggers and real-time adjustments
  • Environment Catalog: Reusable environment and resource definitions
  • Real-time Monitoring: Track progress with adjustable time scaling
  • Schema Validation: Comprehensive program validation

For detailed information, see the Features Guide.


๐Ÿ“– Example Program

Here's a simple breakfast preparation program:

{
  "programId": "breakfast-prep",
  "name": "Breakfast Preparation",
  "environment": "home-kitchen",
  "startTrigger": {"type": "manual"},
  "tracks": [
    {
      "trackId": "eggs",
      "name": "Scrambled Eggs",
      "steps": [
        {
          "stepId": "fry-eggs",
          "name": "Fry Eggs",
          "startTrigger": {"type": "programStart"},
          "task": "stove-burner",
          "duration": {"type": "fixed", "seconds": 180}
        }
      ]
    }
  ]
}

Environment with Resource Constraints

{
  "environmentId": "home-kitchen",
  "actors": 2,
  "resourceConstraints": [
    {
      "task": "stove-burner",
      "maxConcurrent": 4,
      "actorsRequired": 1.0
    },
    {
      "task": "oven", 
      "maxConcurrent": 1,
      "actorsRequired": 0.5
    }
  ]
}

๐Ÿ› ๏ธ Installation

Note: Rhylthyme packages are currently in development and must be installed from local directories.

Quick Installation

# Clone the repository
git clone https://github.com/yourusername/rhylthyme.git
cd rhylthyme

# Create virtual environment
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install core packages
pip install -e ./rhylthyme-spec
pip install -e ./rhylthyme-cli-runner
pip install -e ./rhylthyme-web

# Verify installation
rhylthyme --help

For detailed installation instructions, see the Installation Guide.


๐Ÿƒโ€โ™‚๏ธ Usage

CLI Runner

# Validate a program
rhylthyme validate programs/example.json

# Run a program with interactive terminal UI
rhylthyme run programs/example.json

# Run with automatic start and 2x speed
rhylthyme run programs/example.json --auto-start --time-scale 2.0

# Optimize a program schedule
rhylthyme plan programs/example.json optimized.json

# List available environments
rhylthyme environments

# Get help
rhylthyme --help

Interactive Controls

When running a program, use these keyboard controls:

  • Space: Start/stop program
  • Enter: Trigger manual steps
  • Arrow keys: Navigate between steps
  • q: Quit
  • r: Refresh display

Web Visualizer

Start the web server:

rhylthyme-web

Then open http://localhost:5000 in your browser. You can:

  • Upload a local .json or .yaml file
  • Paste a URL to load from https
  • Try examples with one click

Options:

rhylthyme-web --port 8080 --debug

Command Line Visualization

# Generate and open visualization in browser
rhylthyme-visualize program.json

# Save to specific file without opening browser
rhylthyme-visualize program.json -o output.html --no-browser

Importers

Import schedules from external sources:

# Install importers
pip install -e ./rhylthyme-importers

# Search TheMealDB for recipes
rhylthyme-import search "chicken curry" -i themealdb

# Import a recipe
rhylthyme-import import "52772" -o curry.json --pretty

# Import a random meal
rhylthyme-import mealdb random -o random_meal.json

# Import from protocols.io (requires API token)
export PROTOCOLS_IO_TOKEN="your_token"
rhylthyme-import search "western blot" -i protocolsio

The web chat also supports importing - just ask Claude to "import a recipe for lasagna" or "find me a chicken recipe".


๐Ÿ“ Project Structure

rhylthyme/
โ”œโ”€โ”€ rhylthyme-spec/                # Schema definitions
โ”œโ”€โ”€ rhylthyme-cli-runner/         # Command-line interface
โ”œโ”€โ”€ rhylthyme-web/                # Web visualizer & DAG generator
โ”œโ”€โ”€ rhylthyme-importers/          # Import plugins (TheMealDB, protocols.io)
โ”œโ”€โ”€ rhylthyme-examples/           # Example programs & environments
โ”œโ”€โ”€ rhylthyme-docs/               # Documentation website
โ”œโ”€โ”€ rhylthyme-mcp-server/         # MCP server implementation
โ”œโ”€โ”€ docs/                         # Core documentation
โ”œโ”€โ”€ extensions/                   # Extensions and integrations
โ””โ”€โ”€ DOCUMENTATION_INDEX.md        # Complete documentation index

๐Ÿ“š Documentation

Quick Links

Tool Documentation

Integration Guides


๐Ÿ“‹ Examples

Explore working examples in the rhylthyme-examples directory:

  • breakfast_schedule.json - Simple breakfast coordination
  • lab_experiment.json - Laboratory protocol workflow
  • bakery_program_example.json - Complex bakery production
  • airport_program_example.json - Airport operations scheduling
  • rat_psychopharmacology.json - Research experiment timing

๐Ÿค Contributing

We welcome contributions! See individual repository README files for specific contribution guidelines.

Getting Started

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests and documentation
  5. Submit a pull request

๐Ÿ“„ License

Apache License 2.0 - see LICENSE file for details.


๐Ÿ†˜ Support


Rhylthyme: Making time-critical workflows as smooth as a perfect rhythm. ๐ŸŽต

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

rhylthyme-0.1.0.tar.gz (165.5 kB view details)

Uploaded Source

Built Distribution

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

rhylthyme-0.1.0-py3-none-any.whl (169.5 kB view details)

Uploaded Python 3

File details

Details for the file rhylthyme-0.1.0.tar.gz.

File metadata

  • Download URL: rhylthyme-0.1.0.tar.gz
  • Upload date:
  • Size: 165.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for rhylthyme-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b9182f11a96161705bd5bcc5e004ec7acbe947971e5d8261665fe892f1df563d
MD5 a8198282bdc658bc2f8081ae4df2473c
BLAKE2b-256 0ee004ee526f05bfc178fcf3ae59be55a1bf53078527d41140f0bc7d97ae9cf4

See more details on using hashes here.

File details

Details for the file rhylthyme-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rhylthyme-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 169.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for rhylthyme-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 37363d1e6e26186d8fe64c6e8e6df8b0059920818985830c154b585cb63f1a0f
MD5 e6586d48d9ba27dd6143e45cf76f3668
BLAKE2b-256 7e860b4647a53e9ec56a21b1176c46f39013a6c3cc03c943755545be96958f93

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