view env/lib/python3.9/site-packages/bioblend/toolshed/__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 source

"""
A base representation of an instance of Tool Shed
"""
from bioblend.galaxyclient import GalaxyClient
from bioblend.toolshed import categories, repositories, tools


class ToolShedInstance(GalaxyClient):
    def __init__(self, url, key=None, email=None, password=None, verify=True):
        """
        A base representation of a connection to a ToolShed instance, identified
        by the ToolShed URL and user credentials.

        After you have created a ``ToolShedInstance`` object, access various
        modules via the class fields. For example, to work with repositories and
        get a list of all public repositories, the following should be done::

            from bioblend import toolshed

            ts = toolshed.ToolShedInstance(url='https://testtoolshed.g2.bx.psu.edu')

            rl = ts.repositories.get_repositories()

            tools = ts.tools.search_tools('fastq')

        :type url: str
        :param url: A FQDN or IP for a given instance of ToolShed. For example:
                    https://testtoolshed.g2.bx.psu.edu . If a ToolShed instance
                    is served under a prefix (e.g.
                    http://127.0.0.1:8080/toolshed/), supply the entire URL
                    including the prefix (note that the prefix must end with a
                    slash).

        :type key: str
        :param key: If required, user's API key for the given instance of ToolShed,
                    obtained from the user preferences.

        :type email: str
        :param email: ToolShed e-mail address corresponding to the user.
                      Ignored if key is supplied directly.

        :type password: str
        :param password: Password of ToolShed account corresponding to the above
                         e-mail address. Ignored if key is supplied directly.

        :param verify: Whether to verify the server's TLS certificate
        :type verify: bool
        """
        super().__init__(url, key, email, password, verify=verify)
        self.categories = categories.ToolShedCategoryClient(self)
        self.repositories = repositories.ToolShedRepositoryClient(self)
        self.tools = tools.ToolShedToolClient(self)