diff env/lib/python3.9/site-packages/bioblend/galaxy/tool_data/__init__.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/env/lib/python3.9/site-packages/bioblend/galaxy/tool_data/__init__.py	Mon Mar 22 18:12:50 2021 +0000
@@ -0,0 +1,85 @@
+"""
+Contains possible interactions with the Galaxy Tool data tables
+"""
+from bioblend.galaxy.client import Client
+
+
+class ToolDataClient(Client):
+
+    def __init__(self, galaxy_instance):
+        self.module = 'tool_data'
+        super().__init__(galaxy_instance)
+
+    def get_data_tables(self):
+        """
+        Get the list of all data tables.
+
+        :rtype: list
+        :return: A list of dicts with details on individual data tables.
+          For example::
+
+            [{"model_class": "TabularToolDataTable", "name": "fasta_indexes"},
+             {"model_class": "TabularToolDataTable", "name": "bwa_indexes"}]
+        """
+        return self._get()
+
+    def show_data_table(self, data_table_id):
+        """
+        Get details of a given data table.
+
+        :type data_table_id: str
+        :param data_table_id: ID of the data table
+
+        :rtype: dict
+        :return: A description of the given data table and its content.
+          For example::
+
+            {'columns': ['value', 'dbkey', 'name', 'path'],
+             'fields': [['test id',
+                         'test',
+                         'test name',
+                         '/opt/galaxy-dist/tool-data/test/seq/test id.fa']],
+             'model_class': 'TabularToolDataTable',
+             'name': 'all_fasta'}
+
+        """
+        return self._get(id=data_table_id)
+
+    def reload_data_table(self, data_table_id):
+        """
+        Reload a data table.
+
+        :type data_table_id: str
+        :param data_table_id: ID of the data table
+
+        :rtype: dict
+        :return: A description of the given data table and its content.
+          For example::
+
+            {'columns': ['value', 'dbkey', 'name', 'path'],
+             'fields': [['test id',
+                         'test',
+                         'test name',
+                         '/opt/galaxy-dist/tool-data/test/seq/test id.fa']],
+             'model_class': 'TabularToolDataTable',
+             'name': 'all_fasta'}
+        """
+        url = self._make_url(data_table_id) + '/reload'
+        return self._get(url=url)
+
+    def delete_data_table(self, data_table_id, values):
+        """
+        Delete an item from a data table.
+
+        :type data_table_id: str
+        :param data_table_id: ID of the data table
+
+        :type values: str
+        :param values: a "|" separated list of column contents, there must be a
+          value for all the columns of the data table
+
+        :rtype: dict
+        :return: Remaining contents of the given data table
+        """
+        payload = {'values': values}
+        return self._delete(payload=payload, id=data_table_id)