Curator CLI Wrapper

1.2.4 · active · verified Sun Apr 12

curatorbin is a Python package that simplifies the installation and execution of the Elasticsearch Curator command-line interface. It downloads the `curator` binary during package installation and provides a Python interface to run its commands. The current version is 1.2.4, with releases typically aligned with updates of the underlying Curator binary or specific wrapper improvements.

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use `run_curator_command` to execute arbitrary Curator CLI commands. This function returns the stdout, stderr, and exit code from the underlying binary execution.

from curatorbin import run_curator_command

# Example 1: Check the version of the underlying Curator binary
try:
    stdout, stderr, exit_code = run_curator_command('--version')
    print(f"Curator Version (stdout):\n{stdout.strip()}")
    if stderr:
        print(f"Curator Version (stderr):\n{stderr.strip()}")
    if exit_code != 0:
        print(f"Command '--version' failed with exit code {exit_code}")

    # Example 2: Display Curator's help message (first few lines)
    stdout, stderr, exit_code = run_curator_command('--help')
    print("\nCurator Help (first 10 lines):\n" + "\n".join(stdout.splitlines()[:10]))

except Exception as e:
    print(f"An error occurred during Curator command execution: {e}")

view raw JSON →