Skip to main content

Scriptman

Scriptman is a batteries-included Python automation toolkit that helps you build web automation, ETL pipelines, and scheduled workflows with minimal ceremony.

Features

  • 🚀 Selenium Automation – Cross-platform browser automation with intelligent download handling
  • 📊 ETL Operations – Pandas-powered Extract/Transform/Load helpers for CSV, JSON, and databases
  • 🧠 Task Manager & Services – Cooperative services, multithreaded execution, and retry utilities
  • ⏰ Scheduling – Interval, daily, and one-off triggers with decorator-friendly APIs
  • 🗄️ Database Support – SQLAlchemy and pyodbc integrations out of the box
  • ⚙️ Configuration – Flexible TOML configuration with sensible defaults
  • 📚 Documentation – In-depth guides under scriptman/docs

Quick Start

Installation

pip install scriptman

Hello Scriptman

from datetime import timedelta

from scriptman import TaskManager, scheduler

manager = TaskManager()

# Register a cooperative service loop
def send_heartbeat() -> None: ...  # your implementation

@manager.service(name="heartbeat", autostart=True)
def heartbeat(ctx):
    while not ctx.should_stop:
        send_heartbeat()
        if not ctx.sleep(60):  # exit early if shutdown requested
            break

# Schedule a periodic task
@scheduler.schedule(trigger=scheduler.IntervalTrigger(timedelta(minutes=30)))
def sync_remote_data():
    ...  # your sync routine

if __name__ == "__main__":
    manager.start_service("heartbeat")

Task Manager, Services & Scheduler

from datetime import time

from scriptman import TaskManager, scheduler

manager = TaskManager()

@manager.service(name="report-generator", autostart=True)
def report_service(ctx):
    while not ctx.should_stop:
        generate_incremental_report()
        if not ctx.sleep(300):
            break

@manager.service(name="summary", autostart=False)
def summary_service(ctx):
    generate_summary()

@scheduler.schedule(trigger=scheduler.TimeOfDayTrigger(at=time(hour=21)))
def nightly_rollup() -> None:
    finalize_daily_metrics()

manager.start_service("report-generator")

The scheduler proxy (scriptman.scheduler) is always available, even before a TaskManager is explicitly constructed, and the service proxy (scriptman.service_manager) lets you introspect currently registered services.

Selenium & Downloads

from scriptman.powers.selenium import SeleniumInstance

selenium = SeleniumInstance()
selenium.driver.get("https://example.com")
selenium.interact_with_element("//button[@id='download']", mode="click")
downloaded_file = selenium.wait_for_downloads_to_finish("report.pdf")
print(f"Downloaded: {downloaded_file}")

Scriptman defaults to your system Downloads directory, automatically monitoring Chrome’s default location and relocating finished downloads. Override it in configuration if you need a custom path:

# scriptman.toml
[scriptman]
downloads_dir = "/path/to/custom/downloads"

ETL & Data Pipelines

from scriptman.powers.etl import ETL

etl = (
    ETL.from_db(prod_db, "SELECT * FROM sales")
    .transform(add_calculated_fields)
    .to_db(warehouse_db, "sales_fact", method="upsert")
)

Full ETL documentation—including architecture, examples, and API reference—lives under scriptman/docs/powers/etl.

Configuration Snapshot

# scriptman.toml
[scriptman]
log_level = "INFO"
downloads_dir = "~/Downloads"

[scriptman.selenium]
headless = true
local_mode = true

[scriptman.tasks]
retries = 3
task_timeout = 30

Documentation

Detailed guides and API references live in the scriptman/docs directory. Start with the module READMEs (e.g. the ETL quick-start) and keep an eye out for upcoming documentation on tasks, services, scheduler, Selenium, and database helpers.

License

This project is licensed under the MIT License—see the LICENSE file for details.

Metadata

Release files for scriptman 2.9.584

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

Source distribution (sdist)

Source distribution for scriptman 2.9.584
File Size Uploaded
scriptman-2.9.584.tar.gz 136.2 kB Details

Built distribution (wheel)

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

Total release size: 311.6 kB

Release files / scriptman-2.9.584.tar.gz

Download URL scriptman-2.9.584.tar.gz
Size 136.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b9714c6b7a5d94cb88837f7cb88891de05ce64200f3dcb9a37e35097fee35953
BLAKE2b-256 checksum
How to use checksums
a9a0cb32fa944eedb45c3694e1e410435e2ec6f5cb14c31b3cd55dd089fb13a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.0 Windows/10

Release files / scriptman-2.9.584-py3-none-any.whl

Download URL scriptman-2.9.584-py3-none-any.whl
Size 175.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3a18165b3e62cf24eb15739e0b6213094542438703cef27d921886a9d7068ab
BLAKE2b-256 checksum
How to use checksums
75bdd93d93e14c76818f44d973df405d79024d3d941262ca39c4f083d55c2c77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.14.0 Windows/10

Release history Release notifications | RSS feed

This release

2.9.584 This release

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