Overview

What is Scrippy?

Scrippy is a Python framework for writing standardized, production-ready scripts for system administrators and developers.

A Scrippy script describes itself in a declarative header: its author, version, purpose, the configuration it needs, the options it accepts, who may run it and how many instances may run at once. From that header, and with a single with statement in your code, Scrippy gives every script:

  • Logs: Colored output on the terminal and one log file per execution, with log level handling
  • Execution history: Every execution is recorded with its parameters, duration and exit status
  • Configuration management: A configuration file per script, automatically loaded and validated
  • Option management: Command line options parsed and validated from the header, with an auto-generated --help
  • Secrets protection: Passwords and tokens declared as secret are redacted from logs and history
  • Access control: Restriction of the users and groups allowed to run the script
  • Concurrent executions management: A maximum number of simultaneous executions, with a waiting queue
  • Temporary workspace: A private temporary directory per execution, automatically deleted at the end
  • Error handling: Production-friendly error messages and meaningful exit status

The entire set of features listed above is available to your script without writing a single line of code.

A taste of Scrippy

#!/usr/bin/env python3
"""
--------------------------------------------------------------------------------
  @author         : Luiggi Vercotti
  @date           : 2026-10-08
  @version        : 1.0.0
  @description    : Monitor filesystem usage
--------------------------------------------------------------------------------
  Configuration:
    @conf:thresholds|warning|int|false
--------------------------------------------------------------------------------
  Options:
    @args:mount-point|str|Mount point to check|1|/|||false|false
--------------------------------------------------------------------------------
"""
import shutil
import scrippy_core
from scrippy_core import logger

def main():
  with scrippy_core.ScriptContext() as _context:
    usage = shutil.disk_usage(_context.args.mount_point)
    percent = round(usage.used * 100 / usage.total, 1)
    if percent >= _context.config.get("thresholds", "warning", "int"):
      logger.warning(f"[+] {_context.args.mount_point}: {percent}% used")

if __name__ == '__main__':
  main()

This short script already has an help (--help), a version (--version), a validated configuration file, a validated --mount-point option, a log file per execution (--log), an execution history (--hist), a debug mode (--debug) and a temporary workspace.

The Scrippy framework

Scrippy is made of a core package and of optional modules, each one dedicated to a specific task:

Package Purpose
scrippy The installer and configuration helper
scrippy-core The core of the framework: Header, configuration, options, logs, history...
scrippy-template Document generation from Jinja2 templates
scrippy-remote Remote command execution and file transfers (SSH/SFTP, FTP/FTPS, CIFS)
scrippy-snmp SNMP get, walk and set operations
scrippy-db Database queries (PostgreSQL, MySQL, SQLite)
scrippy-api REST API client, with OpenAPI support
scrippy-mail Emails sending and reading (SMTP, IMAP, POP3)
scrippy-git Git repositories management

How to read this documentation

  1. Requirements, Installation and Configuration set up the Scrippy environment.
  2. The Tutorial builds a real script step by step, introducing the Scrippy concepts one at a time.
  3. The Reference describes exhaustively every element of scrippy-core.
  4. The Modules pages extend the tutorial script with each Scrippy module and describe each module.

To discover Scrippy at a glance, visit its presentation website: https://www.scrippy.org.

Scrippy is free software released under the MIT license. Its source code is available at https://codeberg.org/scrippy.