Skip to main content

A powerful Python package for automation, script management, and workflow orchestration.

Project description

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scriptman-2.9.584.tar.gz (136.2 kB view details)

Uploaded Source

Built Distribution

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

scriptman-2.9.584-py3-none-any.whl (175.4 kB view details)

Uploaded Python 3

File details

Details for the file scriptman-2.9.584.tar.gz.

File metadata

  • Download URL: scriptman-2.9.584.tar.gz
  • Upload date:
  • Size: 136.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Windows/10

File hashes

Hashes for scriptman-2.9.584.tar.gz
Algorithm Hash digest
SHA256 b9714c6b7a5d94cb88837f7cb88891de05ce64200f3dcb9a37e35097fee35953
MD5 94d2ddac32bb19c6d8ea9b0ff89783cf
BLAKE2b-256 a9a0cb32fa944eedb45c3694e1e410435e2ec6f5cb14c31b3cd55dd089fb13a0

See more details on using hashes here.

File details

Details for the file scriptman-2.9.584-py3-none-any.whl.

File metadata

  • Download URL: scriptman-2.9.584-py3-none-any.whl
  • Upload date:
  • Size: 175.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Windows/10

File hashes

Hashes for scriptman-2.9.584-py3-none-any.whl
Algorithm Hash digest
SHA256 a3a18165b3e62cf24eb15739e0b6213094542438703cef27d921886a9d7068ab
MD5 619e57a2b9206219ad1f79520ea88609
BLAKE2b-256 75bdd93d93e14c76818f44d973df405d79024d3d941262ca39c4f083d55c2c77

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