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 classQuick Start
bash
# Install
pip install -e .
playwright install chromium
# Start daemon
sweatpants serve
# Check status
sweatpants statusDocumentation
CLI
- CLI Commands — Command-line interface reference
API
- REST API — HTTP endpoints and WebSocket streaming
Configuration
- Configuration — Environment variables and settings
Module Development (SDK)
- Module Class — Base class for automation modules
- Module Manifest — module.json schema
- Proxy Client — HTTP requests through rotating proxy
- Browser Pool — Playwright browser automation
Engine Internals
- Job Scheduler — Async job execution
- Module Loader — Module installation and loading
Package Exports
The main package exports three items:
python
from sweatpants import Module, proxied_request, get_browserModule— Base class for automation modulesproxied_request— Async HTTP client with proxy supportget_browser— Playwright browser context manager