Skip to main content

Seqript (Sequence + Script)

A lightweight framework for executing structured scripts with nested operations.

Features

  • Define scripts as nested JSON structures
  • Register custom engines for different operations
  • Environment variable expansion support
  • Sequential and parallel execution modes
  • Extensible through engine contributions

Documentation

Installation

pip install seqript (TODO: Add actual installation method)

Example

{
  "seq": [
    {"comment": "Starting operations"},
    {"sleep": 1},
    {"par": [
      {"cmd": ["echo", "Task 1"]},
      {"cmd": ["echo", "Task 2"]}
    ]}
  ]
}

Project Structure

Core Components

  • Seqript: Main class that parses and executes scripts
  • Engines: Modular operations (cmd, seq, par, etc.)
  • Variable Expansion: ${var} substitution system

File Organization

seqript/
├── init.py
├── seqript.py # Main class
├── util/
│   └── expand_variable.py
└── engine/
    ├── init.py
    ├── cmd.py # Command execution
    ├── nop.py # No operation
    ├── par.py # Parallel execution
    ├── seq.py # Sequential execution
    └── contrib/ # Additional engines
        ├── sleep.py
        └── comment.py

Extension Points

  1. Add engines to engine/contrib/
  2. Override default engines during initialization
  3. Extend variable expansion patterns## Extension Points

Usage Guide

Script Structure

Scripts are JSON objects where each key represents an engine:

{
  "engine_name": engine_specific_configuration
}

Environment Variables

Use ${VAR} syntax in strings for variable expansion:

{
  "cmd": ["echo", "${MESSAGE}"],
  "env": {"MESSAGE": "Hello"}
}

Custom Engines

Register additional engines during initialization:

from seqript import Seqript

def custom_engine(seqript, **kwargs):
    print(f"Custom engine called with {kwargs}")

seqript = Seqript(engines={
    "custom": custom_engine,
    **Seqript._DEFAULT_ENGINES
})

Quick Start

Basic Usage

  1. Create a script file (example.json):
{
  "seq": [
    {"comment": "My first script"},
    {"sleep": 2},
    {"cmd": ["echo", "Hello World"]}
  ]
}
  1. Execute it:
from seqript import Seqript

seqript = Seqript(name="example")
with open("example.json") as f:
    seqript(**json.load(f))

Available Engines

  • seq: Sequential execution
  • par: Parallel execution
  • cmd: Command execution
  • nop: No operation
  • sleep: Delay execution
  • comment: Print message

Release files for Seqript 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Seqript 1.0.0
File Size Uploaded
seqript-1.0.0.tar.gz 6.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Seqript 1.0.0
File Interpreter ABI Platform
seqript-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.6 kB

Release files / seqript-1.0.0.tar.gz

Download URL seqript-1.0.0.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fcce83aee93c0a7469848cd9c00cbf020fdcde9670ed405bdf40b3bc500b4433
BLAKE2b-256 checksum
How to use checksums
bfc5b8307bc18ebbdba59a20e93d574f097f53f1934f984e66c0b589f05052e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / seqript-1.0.0-py3-none-any.whl

Download URL seqript-1.0.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65657998bb667a3af663b8c313871f751cec8a8159aed3d672e4b50d8def7117
BLAKE2b-256 checksum
How to use checksums
6e2ae5955fd06bc7b407cef734f34e068615005aec171735e39e280fcdd6f84f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page