{"id":4488,"library":"curatorbin","title":"Curator CLI Wrapper","description":"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.","status":"active","version":"1.2.4","language":"en","source_language":"en","source_url":"https://github.com/evergreen-ci/curatorbin","tags":["cli","wrapper","elasticsearch","curator","automation"],"install":[{"cmd":"pip install curatorbin","lang":"bash","label":"Install `curatorbin`"}],"dependencies":[],"imports":[{"note":"This is the primary function for programmatically executing Curator commands.","symbol":"run_curator_command","correct":"from curatorbin import run_curator_command"},{"note":"The `main` function for the CLI is in `curatorbin.cli`, not directly in the package root. However, it's typically invoked via the `curator` command-line entry point installed by the package.","wrong":"from curatorbin import main","symbol":"main (CLI entry)","correct":"import curatorbin.cli\ncuratorbin.cli.main()"}],"quickstart":{"code":"from curatorbin import run_curator_command\n\n# Example 1: Check the version of the underlying Curator binary\ntry:\n    stdout, stderr, exit_code = run_curator_command('--version')\n    print(f\"Curator Version (stdout):\\n{stdout.strip()}\")\n    if stderr:\n        print(f\"Curator Version (stderr):\\n{stderr.strip()}\")\n    if exit_code != 0:\n        print(f\"Command '--version' failed with exit code {exit_code}\")\n\n    # Example 2: Display Curator's help message (first few lines)\n    stdout, stderr, exit_code = run_curator_command('--help')\n    print(\"\\nCurator Help (first 10 lines):\\n\" + \"\\n\".join(stdout.splitlines()[:10]))\n\nexcept Exception as e:\n    print(f\"An error occurred during Curator command execution: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"Understand that `curatorbin` primarily executes `curator` CLI commands. Use `run_curator_command` to pass arguments as strings, similar to how you'd use the command line.","message":"curatorbin is a Python wrapper for the external `curator` command-line interface, not a pure Python client library for interacting with Elasticsearch. If you need to manage Elasticsearch indices programmatically with Python objects, consider using the `elasticsearch-py` library directly.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure the system has stable internet connectivity and the user executing `pip install` has permissions to download and create executable files. Check the installation logs for specific error messages.","message":"During `pip install curatorbin`, the package attempts to download the `curator` binary from `https://download.elastic.co`. This process requires network access and appropriate file system permissions. Installation may fail or be slow if these conditions are not met.","severity":"gotcha","affected_versions":"All"},{"fix":"When using `curatorbin` programmatically, always use `curatorbin.run_curator_command()` or the specific `curator` entry point installed by the package to ensure the correct binary is invoked. Avoid relying on simply calling `curator` if your PATH might contain other versions.","message":"If another `curator` executable is already present in your system's PATH, there's a potential for conflict. `curatorbin` aims to use its managed binary, but relying on global PATH settings can lead to unexpected behavior if not carefully managed.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}