File: __init__.py

package info (click to toggle)
python-bioblend 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,096 kB
  • sloc: python: 7,596; sh: 219; makefile: 158
file content (65 lines) | stat: -rw-r--r-- 2,368 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
A base representation of an instance of Tool Shed
"""
from typing import Optional

from bioblend.galaxyclient import GalaxyClient
from bioblend.toolshed import (
    categories,
    repositories,
    tools,
)


class ToolShedInstance(GalaxyClient):
    def __init__(
        self,
        url: str,
        key: Optional[str] = None,
        email: Optional[str] = None,
        password: Optional[str] = None,
        verify: bool = True,
    ) -> None:
        """
        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)