{"id":7984,"library":"bioblend","title":"BioBlend","description":"BioBlend is a Python library for interacting with the Galaxy API. It simplifies scripting and automating Galaxy analyses, as well as administering a Galaxy server. The library supports Python 3.10 - 3.14 and Galaxy release 19.05 and later. It is actively developed and maintained, with regular releases.","status":"active","version":"1.9.0","language":"en","source_language":"en","source_url":"https://github.com/galaxyproject/bioblend","tags":["galaxy","bioinformatics","api-client","workflow-automation"],"install":[{"cmd":"pip install bioblend","lang":"bash","label":"Install BioBlend"}],"dependencies":[],"imports":[{"note":"Used for the original, function-based API interactions.","symbol":"GalaxyInstance (standard API)","correct":"from bioblend.galaxy import GalaxyInstance"},{"note":"Provides a more object-oriented way to interact with Galaxy entities, though it may have a more restricted set of modules compared to the standard API.","symbol":"GalaxyInstance (object-oriented API)","correct":"from bioblend.galaxy.objects import GalaxyInstance"}],"quickstart":{"code":"import os\nfrom bioblend.galaxy import GalaxyInstance\n\n# Replace with your Galaxy URL and API key or set as environment variables\nGALAXY_URL = os.environ.get('GALAXY_URL', 'http://localhost:8080')\nGALAXY_API_KEY = os.environ.get('GALAXY_API_KEY', 'YOUR_API_KEY_HERE')\n\nif GALAXY_API_KEY == 'YOUR_API_KEY_HERE':\n    print(\"Warning: Please replace 'YOUR_API_KEY_HERE' with your actual Galaxy API key or set the GALAXY_API_KEY environment variable.\")\n    exit(1)\n\ntry:\n    # Connect to the Galaxy instance\n    gi = GalaxyInstance(GALAXY_URL, key=GALAXY_API_KEY)\n\n    # Example: Get a list of available histories\n    histories = gi.histories.get_histories()\n    print(f\"Found {len(histories)} histories:\")\n    for hist in histories[:3]: # Print first 3 histories\n        print(f\"  - Name: {hist['name']}, ID: {hist['id']}\")\n\n    # Example: Get current Galaxy version\n    version = gi.config.get_version()\n    print(f\"Galaxy Version: {version}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure your Galaxy server is running and accessible, and your API key is correct.\")","lang":"python","description":"This quickstart demonstrates how to connect to a Galaxy instance using `bioblend` and perform basic operations like listing histories and retrieving the Galaxy version. Ensure your Galaxy server is running and your API key is configured either directly in the script or via environment variables."},"warnings":[{"fix":"Ensure your `GalaxyInstance` initialization and subsequent API calls correctly pass the API key using the `key` parameter during `GalaxyInstance` creation, which handles the header internally. Old scripts might need updating.","message":"API key authentication mechanism changed in BioBlend v0.16.0. The API key must now be passed via the `x-api-key` header instead of as a direct parameter in some requests.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Refer to the BioBlend documentation for the current equivalents. For example, `export_workflow_dict()` and `import_workflow_dict()` replace the JSON-specific workflow methods.","message":"Several methods were deprecated and removed in BioBlend v0.15.0, including `HistoryClient.download_dataset()`, `HistoryClient.get_current_history()`, `WorkflowClient.export_workflow_json()`, and `WorkflowClient.import_workflow_json()`.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Choose the appropriate `GalaxyInstance` based on your desired interaction style. The standard API (`bioblend.galaxy`) generally offers broader coverage, while the `objects` API provides a more Pythonic interface for common tasks. Be aware that methods available on one might not be on the other.","message":"There are two `GalaxyInstance` classes available: `bioblend.galaxy.GalaxyInstance` and `bioblend.galaxy.objects.GalaxyInstance`. They expose different API styles (procedural vs. object-oriented) and may have different coverage of Galaxy modules.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify the `GALAXY_URL` is correct and accessible. Ensure the Galaxy server is running and configured to accept API connections. Check firewall rules if connecting remotely.","cause":"The Galaxy server URL is incorrect, the server is not running, or there are network issues preventing connection.","error":"bioblend.galaxy.client.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))"},{"fix":"Double-check your `GALAXY_API_KEY` for typos. Ensure the key belongs to a user with the necessary permissions on the Galaxy server. Generate a new API key if unsure.","cause":"The provided API key is invalid, has insufficient permissions, or the Galaxy server requires authentication that was not met.","error":"bioblend.galaxy.client.GalaxyAPIError: Client error: 403 Forbidden - Please provide a valid API key."},{"fix":"Consult the BioBlend documentation (e.g., `bioblend.readthedocs.io`) for the version you are using to find the updated method for retrieving the current history, or refactor your code to use `get_histories()` and select the desired one.","cause":"You are trying to use a method that has been deprecated and removed from the BioBlend library in newer versions.","error":"AttributeError: 'HistoryClient' object has no attribute 'get_current_history'"}]}