The `galaxy-util` package provides common utility functions and helper classes used across the larger Galaxy bioinformatics platform. It is an integral part of the Galaxy ecosystem, supporting various functionalities within the main application. Currently at version 26.0.0, it follows the rapid release cadence of the main Galaxy project, often tied to its major releases. While available on PyPI, its primary use case is within the Galaxy project itself.
pip install galaxy-utilVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic usage of two common utility functions: `safe_path` for sanitizing path components and `sanitize_text` for removing potentially dangerous HTML/script tags from strings. These are representative of the type of general-purpose helpers found in `galaxy-util`.
Refer to the Galaxy project's official release notes and source code (`lib/galaxy/util` directory in the main Galaxy repository) for the specific version you are using to confirm API stability and correct usage.
Consider if a more general-purpose Python library exists for your specific utility need before integrating `galaxy-util` into non-Galaxy applications. Be prepared for potential API instability if you do use it externally.
Ensure that your `galaxy-util` version is compatible with your `galaxy` core version. Ideally, manage dependencies through the main Galaxy project's recommended setup or requirements.txt.
Ensure the package is installed: `pip install galaxy-util`. If using a virtual environment, ensure it's activated.
Check the `galaxy.util` source code in the Galaxy project's GitHub repository (`lib/galaxy/util` for your specific version) to find the current API or an alternative. Update your code to reflect the new API.
Consult the Galaxy project's official documentation or examine the source code for the exact `galaxy-util` version you are using to determine the correct import path or if the functionality has been replaced.