Sweatpants Documentation

Server-side automation engine for long-running tasks.

Overview

Sweatpants is a server-side Python engine for repeatable, long-running automation tasks. Write modules as async generators, install them, run them as jobs. The engine handles persistence, logging, checkpointing, resume, and real-time log streaming.

Architecture

sweatpants/
├── api/          # FastAPI REST server
├── browser/      # Playwright browser pool
├── engine/       # Job scheduler and module loader
├── proxy/        # HTTP client with rotating proxy
└── sdk/          # Module development base class

Quick Start

bash
# Install
pip install -e .
playwright install chromium

# Start daemon
sweatpants serve

# Check status
sweatpants status

Documentation

CLI

API

  • REST API — HTTP endpoints and WebSocket streaming

Configuration

Module Development (SDK)

Engine Internals

Package Exports

The main package exports three items:

python
from sweatpants import Module, proxied_request, get_browser
  • Module — Base class for automation modules
  • proxied_request — Async HTTP client with proxy support
  • get_browser — Playwright browser context manager