pybiolib 1.2.520__tar.gz → 1.2.561__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybiolib-1.2.520 → pybiolib-1.2.561}/PKG-INFO +2 -2
- pybiolib-1.2.561/biolib/__init__.py +338 -0
- pybiolib-1.2.561/biolib/_internal/types/resource_version.py +13 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/typing.py +3 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/app/app.py +1 -1
- {pybiolib-1.2.520 → pybiolib-1.2.561}/pyproject.toml +2 -2
- pybiolib-1.2.520/biolib/__init__.py +0 -145
- pybiolib-1.2.520/biolib/_internal/types/resource_version.py +0 -7
- {pybiolib-1.2.520 → pybiolib-1.2.561}/LICENSE +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/PYPI_README.md +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_data_record/data_record.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/data_record/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/data_record/data_record.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/data_record/push_data.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/data_record/remote_storage_endpoint.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/file_utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/fuse_mount/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/fuse_mount/experiment_fuse_mount.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/http_client.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/lfs/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/lfs/cache.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/libs/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/libs/fusepy/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/push_application.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/runtime.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/app.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/data_record.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/experiment.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/file_node.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/types/resource.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/utils/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/utils/multinode.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_runtime/runtime.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/api/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/api/client.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/app/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/app/search_apps.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/api_client.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/app_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/auth.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/biolib_app_api.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/biolib_job_api.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/common_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/job_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/lfs_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_api_client/user_state.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/base_bbf_package.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/file_in_container.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/module_input.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/module_output_v2.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/remote_endpoints.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/remote_stream_seeker.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/saved_job.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/stdout_and_stderr.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/system_exception.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/system_status_update.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_binary_format/utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_docker_client/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_download_container.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_errors.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/biolib_logging.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/auth.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/data_record.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/download_container.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/init.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/lfs.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/push.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/run.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/runtime.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/cli/start.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/.gitignore +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/cloud_utils/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/cloud_utils/cloud_utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/cache_state.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/cache_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/docker_image_cache.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/docker_executor.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/docker_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/tars/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/job_storage.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/job_worker.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/large_file_system.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/mappings.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/utilization_reporter_thread.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/remote_host_proxy.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/socker_listener_thread.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/socket_sender_thread.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/gunicorn_flask_application.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/webserver.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/webserver_types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/webserver_utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/worker_thread.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/experiments/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/experiments/experiment.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/jobs/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/jobs/job.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/jobs/job_result.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/jobs/types.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/py.typed +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/runtime/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/sdk/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/tables.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/templates/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/templates/example_app.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/typing_utils.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/user/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/user/sign_in.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/utils/__init__.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/utils/app_uri.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/utils/cache_state.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/utils/multipart_uploader.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/utils/seq_util.py +0 -0
- {pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/utils/zip/remote_zip.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: pybiolib
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.561
|
4
4
|
Summary: BioLib Python Client
|
5
5
|
License: MIT
|
6
6
|
Keywords: biolib
|
@@ -26,7 +26,7 @@ Requires-Dist: gunicorn (>=20.1.0) ; extra == "compute-node"
|
|
26
26
|
Requires-Dist: importlib-metadata (>=1.6.1)
|
27
27
|
Requires-Dist: pyyaml (>=5.3.1)
|
28
28
|
Requires-Dist: rich (>=12.4.4)
|
29
|
-
Requires-Dist:
|
29
|
+
Requires-Dist: typing-extensions (>=4.1.0) ; python_version < "3.11"
|
30
30
|
Project-URL: Homepage, https://github.com/biolib
|
31
31
|
Description-Content-Type: text/markdown
|
32
32
|
|
@@ -0,0 +1,338 @@
|
|
1
|
+
# Imports to hide
|
2
|
+
import os
|
3
|
+
from urllib.parse import urlparse as _urlparse
|
4
|
+
|
5
|
+
from biolib import typing_utils as _typing_utils
|
6
|
+
from biolib.app import BioLibApp as _BioLibApp
|
7
|
+
# TODO: Fix ignore of type
|
8
|
+
from biolib.app.search_apps import search_apps # type: ignore
|
9
|
+
from biolib.biolib_errors import BioLibError
|
10
|
+
from biolib.biolib_logging import logger as _logger, logger_no_user_data as _logger_no_user_data
|
11
|
+
from biolib.experiments.experiment import Experiment
|
12
|
+
from biolib.biolib_api_client import BiolibApiClient as _BioLibApiClient, App
|
13
|
+
from biolib.jobs import Job as _Job
|
14
|
+
from biolib import user as _user
|
15
|
+
from biolib.typing_utils import List, Optional, cast as _cast
|
16
|
+
from biolib._data_record.data_record import DataRecord as _DataRecord
|
17
|
+
|
18
|
+
import biolib.api
|
19
|
+
import biolib.app
|
20
|
+
import biolib.cli
|
21
|
+
import biolib.sdk
|
22
|
+
import biolib.utils
|
23
|
+
|
24
|
+
|
25
|
+
# ------------------------------------ Function definitions for public Python API ------------------------------------
|
26
|
+
|
27
|
+
def call_cli() -> None:
|
28
|
+
biolib.cli.cli()
|
29
|
+
|
30
|
+
|
31
|
+
def load(uri: str) -> _BioLibApp:
|
32
|
+
r"""Load a BioLib application by its URI or website URL.
|
33
|
+
|
34
|
+
Args:
|
35
|
+
uri (str): The URI or website URL of the application to load. Can be either:
|
36
|
+
- App URI (e.g., 'biolib/myapp:1.0.0')
|
37
|
+
- Website URL (e.g., 'https://biolib.com/biolib/myapp/')
|
38
|
+
|
39
|
+
Returns:
|
40
|
+
BioLibApp: The loaded application object
|
41
|
+
|
42
|
+
Example::
|
43
|
+
|
44
|
+
>>> # Load by URI
|
45
|
+
>>> app = biolib.load('biolib/myapp:1.0.0')
|
46
|
+
>>> # Load by website URL
|
47
|
+
>>> app = biolib.load('https://biolib.com/biolib/myapp/')
|
48
|
+
>>> result = app.cli('--help')
|
49
|
+
"""
|
50
|
+
return _BioLibApp(uri)
|
51
|
+
|
52
|
+
|
53
|
+
def search(
|
54
|
+
search_query: Optional[str] = None,
|
55
|
+
team: Optional[str] = None,
|
56
|
+
count: int = 100,
|
57
|
+
) -> List[str]:
|
58
|
+
r"""Search for BioLib applications.
|
59
|
+
|
60
|
+
Args:
|
61
|
+
search_query (str, optional): Search query string
|
62
|
+
team (str, optional): Filter by team name
|
63
|
+
count (int): Maximum number of results to return. Defaults to 100.
|
64
|
+
|
65
|
+
Returns:
|
66
|
+
List[str]: List of application URIs matching the search criteria
|
67
|
+
|
68
|
+
Example::
|
69
|
+
|
70
|
+
>>> # Search all apps
|
71
|
+
>>> apps = biolib.search()
|
72
|
+
>>> # Search by query
|
73
|
+
>>> alignment_apps = biolib.search('alignment')
|
74
|
+
>>> # Search team's apps
|
75
|
+
>>> team_apps = biolib.search(team='myteam')
|
76
|
+
"""
|
77
|
+
apps: List[str] = search_apps(search_query, team, count)
|
78
|
+
return apps
|
79
|
+
|
80
|
+
|
81
|
+
def get_job(job_id: str, job_token: Optional[str] = None) -> _Job:
|
82
|
+
r"""Get a job by its ID.
|
83
|
+
|
84
|
+
Args:
|
85
|
+
job_id (str): The UUID of the job to retrieve
|
86
|
+
job_token (str, optional): Authentication token for accessing the job.
|
87
|
+
Only needed for jobs that aren't owned by the current user.
|
88
|
+
|
89
|
+
Returns:
|
90
|
+
Job: The job object
|
91
|
+
|
92
|
+
Example::
|
93
|
+
|
94
|
+
>>> job = biolib.get_job('abc123')
|
95
|
+
>>> # Access shared job
|
96
|
+
>>> job = biolib.get_job('abc123', job_token='xyz789')
|
97
|
+
"""
|
98
|
+
return _Job.create_from_uuid(uuid=job_id, auth_token=job_token)
|
99
|
+
|
100
|
+
|
101
|
+
def get_data_record(uri: str) -> _DataRecord:
|
102
|
+
r"""Get a data record by its URI.
|
103
|
+
|
104
|
+
Args:
|
105
|
+
uri (str): The URI of the data record to retrieve
|
106
|
+
|
107
|
+
Returns:
|
108
|
+
DataRecord: The data record object
|
109
|
+
|
110
|
+
Example::
|
111
|
+
|
112
|
+
>>> record = biolib.get_data_record('biolib/data/sequences:1.0.0')
|
113
|
+
"""
|
114
|
+
return _DataRecord.get_by_uri(uri)
|
115
|
+
|
116
|
+
|
117
|
+
def fetch_jobs(count: int = 25, status: Optional[str] = None) -> List[_Job]:
|
118
|
+
r"""Fetch a list of jobs from the server.
|
119
|
+
|
120
|
+
Args:
|
121
|
+
count (int): Maximum number of jobs to fetch. Defaults to 25.
|
122
|
+
status (str, optional): Filter jobs by status. One of:
|
123
|
+
'in_progress', 'completed', 'failed', 'cancelled'
|
124
|
+
|
125
|
+
Returns:
|
126
|
+
List[Job]: List of job objects matching the criteria
|
127
|
+
|
128
|
+
Example::
|
129
|
+
|
130
|
+
>>> # Get last 10 completed jobs
|
131
|
+
>>> jobs = biolib.fetch_jobs(10, status='completed')
|
132
|
+
>>> # Get last 100 jobs of any status
|
133
|
+
>>> all_jobs = biolib.fetch_jobs(100)
|
134
|
+
"""
|
135
|
+
return _Job.fetch_jobs(count, status)
|
136
|
+
|
137
|
+
|
138
|
+
def fetch_data_records(uri: Optional[str] = None, count: Optional[int] = None) -> List[_DataRecord]:
|
139
|
+
r"""Fetch a list of data records from the server.
|
140
|
+
|
141
|
+
Args:
|
142
|
+
uri (str, optional): Filter records by URI prefix
|
143
|
+
count (int, optional): Maximum number of records to fetch
|
144
|
+
|
145
|
+
Returns:
|
146
|
+
List[DataRecord]: List of data record objects matching the criteria
|
147
|
+
|
148
|
+
Example::
|
149
|
+
|
150
|
+
>>> # Get all records
|
151
|
+
>>> records = biolib.fetch_data_records()
|
152
|
+
>>> # Get records with URI prefix
|
153
|
+
>>> seq_records = biolib.fetch_data_records('biolib/data/sequences')
|
154
|
+
"""
|
155
|
+
return _DataRecord.fetch(uri, count)
|
156
|
+
|
157
|
+
|
158
|
+
def get_experiment(uri: Optional[str] = None, name: Optional[str] = None) -> Experiment:
|
159
|
+
r"""Get an experiment by its URI or name.
|
160
|
+
|
161
|
+
Args:
|
162
|
+
uri (str, optional): The URI of the experiment
|
163
|
+
name (str, optional): The name of the experiment
|
164
|
+
|
165
|
+
Returns:
|
166
|
+
Experiment: The experiment object
|
167
|
+
|
168
|
+
Raises:
|
169
|
+
ValueError: If neither or both uri and name are provided
|
170
|
+
|
171
|
+
Example::
|
172
|
+
|
173
|
+
>>> # Get by URI
|
174
|
+
>>> exp = biolib.get_experiment(uri='biolib/experiments/analysis')
|
175
|
+
>>> # Get by name
|
176
|
+
>>> exp = biolib.get_experiment(name='sequence-analysis')
|
177
|
+
"""
|
178
|
+
if (not uri and not name) or (uri and name):
|
179
|
+
raise ValueError('Must provide either uri or name')
|
180
|
+
|
181
|
+
return Experiment.get_by_uri(uri=_cast(str, uri or name))
|
182
|
+
|
183
|
+
|
184
|
+
def show_jobs(count: int = 25) -> None:
|
185
|
+
r"""Display a table of recent jobs.
|
186
|
+
|
187
|
+
Args:
|
188
|
+
count (int): Maximum number of jobs to display. Defaults to 25.
|
189
|
+
|
190
|
+
Example::
|
191
|
+
|
192
|
+
>>> biolib.show_jobs() # Show last 25 jobs
|
193
|
+
>>> biolib.show_jobs(100) # Show last 100 jobs
|
194
|
+
"""
|
195
|
+
_Job.show_jobs(count=count)
|
196
|
+
|
197
|
+
|
198
|
+
def show_experiments(count: int = 25) -> None:
|
199
|
+
r"""Display a table of experiments.
|
200
|
+
|
201
|
+
Args:
|
202
|
+
count (int): Maximum number of experiments to display. Defaults to 25.
|
203
|
+
|
204
|
+
Example::
|
205
|
+
|
206
|
+
>>> biolib.show_experiments() # Show last 25 experiments
|
207
|
+
>>> biolib.show_experiments(100) # Show last 100 experiments
|
208
|
+
"""
|
209
|
+
Experiment.show_experiments(count=count)
|
210
|
+
|
211
|
+
|
212
|
+
def sign_in() -> None:
|
213
|
+
_user.sign_in()
|
214
|
+
|
215
|
+
|
216
|
+
def sign_out() -> None:
|
217
|
+
_user.sign_out()
|
218
|
+
|
219
|
+
|
220
|
+
def login() -> None:
|
221
|
+
r"""Alias for :func:`sign_in`.
|
222
|
+
|
223
|
+
Example::
|
224
|
+
|
225
|
+
>>> biolib.login() # Same as biolib.sign_in()
|
226
|
+
"""
|
227
|
+
sign_in()
|
228
|
+
|
229
|
+
|
230
|
+
def logout() -> None:
|
231
|
+
r"""Alias for :func:`sign_out`.
|
232
|
+
|
233
|
+
Example::
|
234
|
+
|
235
|
+
>>> biolib.logout() # Same as biolib.sign_out()
|
236
|
+
"""
|
237
|
+
sign_out()
|
238
|
+
|
239
|
+
|
240
|
+
def set_api_base_url(api_base_url: str) -> None:
|
241
|
+
r"""Set the base URL for the BioLib API.
|
242
|
+
|
243
|
+
Args:
|
244
|
+
api_base_url (str): The base URL for the BioLib API
|
245
|
+
|
246
|
+
Example::
|
247
|
+
|
248
|
+
>>> biolib.set_api_base_url('https://biolib.com')
|
249
|
+
|
250
|
+
Note:
|
251
|
+
This will also update related configuration like site hostname
|
252
|
+
and environment flags.
|
253
|
+
"""
|
254
|
+
_BioLibApiClient.initialize(base_url=api_base_url)
|
255
|
+
biolib.utils.BIOLIB_BASE_URL = api_base_url
|
256
|
+
biolib.utils.BIOLIB_SITE_HOSTNAME = _urlparse(api_base_url).hostname
|
257
|
+
biolib.utils.BASE_URL_IS_PUBLIC_BIOLIB = api_base_url.endswith('biolib.com') or (
|
258
|
+
os.environ.get('BIOLIB_ENVIRONMENT_IS_PUBLIC_BIOLIB', '').upper() == 'TRUE'
|
259
|
+
)
|
260
|
+
|
261
|
+
|
262
|
+
def set_base_url(base_url: str) -> None:
|
263
|
+
r"""Alias for :func:`set_api_base_url`.
|
264
|
+
|
265
|
+
Args:
|
266
|
+
base_url (str): The base URL for the BioLib API
|
267
|
+
|
268
|
+
Example::
|
269
|
+
|
270
|
+
>>> biolib.set_base_url('https://biolib.com')
|
271
|
+
"""
|
272
|
+
return set_api_base_url(base_url)
|
273
|
+
|
274
|
+
|
275
|
+
def set_api_token(api_token: str) -> None:
|
276
|
+
r"""Sign in using an API token.
|
277
|
+
|
278
|
+
Args:
|
279
|
+
api_token (str): The API token to authenticate with
|
280
|
+
|
281
|
+
Example::
|
282
|
+
|
283
|
+
>>> biolib.set_api_token('my-api-token')
|
284
|
+
# Signed in using API token
|
285
|
+
"""
|
286
|
+
api_client = _BioLibApiClient.get()
|
287
|
+
api_client.sign_in_with_api_token(api_token)
|
288
|
+
|
289
|
+
|
290
|
+
def set_log_level(level: _typing_utils.Union[str, int]) -> None:
|
291
|
+
r"""Set the logging level for BioLib.
|
292
|
+
|
293
|
+
Args:
|
294
|
+
level (Union[str, int]): The log level to use. Can be a string
|
295
|
+
('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL') or an integer
|
296
|
+
level from the logging module.
|
297
|
+
|
298
|
+
Example::
|
299
|
+
|
300
|
+
>>> biolib.set_log_level('DEBUG') # Enable debug logging
|
301
|
+
>>> biolib.set_log_level('WARNING') # Only show warnings and errors
|
302
|
+
"""
|
303
|
+
_logger.setLevel(level)
|
304
|
+
_logger_no_user_data.setLevel(level)
|
305
|
+
|
306
|
+
|
307
|
+
def _configure_requests_certificates():
|
308
|
+
if os.getenv('REQUESTS_CA_BUNDLE'):
|
309
|
+
if not os.getenv('SSL_CERT_FILE'):
|
310
|
+
# set SSL_CERT_FILE to urllib use same certs
|
311
|
+
os.environ['SSL_CERT_FILE'] = os.getenv('REQUESTS_CA_BUNDLE')
|
312
|
+
return # don't change REQUESTS_CA_BUNDLE if manually configured
|
313
|
+
|
314
|
+
certs_to_check = [
|
315
|
+
'/etc/ssl/certs/ca-certificates.crt',
|
316
|
+
'/etc/pki/tls/certs/ca-bundle.crt',
|
317
|
+
'/etc/ssl/ca-bundle.pem',
|
318
|
+
'/etc/pki/tls/cacert.pem',
|
319
|
+
'/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem',
|
320
|
+
'/etc/ssl/cert.pem',
|
321
|
+
]
|
322
|
+
|
323
|
+
for cert in certs_to_check:
|
324
|
+
if os.path.exists(cert):
|
325
|
+
os.environ['REQUESTS_CA_BUNDLE'] = cert
|
326
|
+
if not os.getenv('SSL_CERT_FILE'):
|
327
|
+
os.environ['SSL_CERT_FILE'] = cert
|
328
|
+
return
|
329
|
+
|
330
|
+
|
331
|
+
# -------------------------------------------------- Configuration ---------------------------------------------------
|
332
|
+
__version__ = biolib.utils.BIOLIB_PACKAGE_VERSION
|
333
|
+
_DEFAULT_LOG_LEVEL = 'INFO' if biolib.utils.IS_RUNNING_IN_NOTEBOOK else 'WARNING'
|
334
|
+
_logger.configure(default_log_level=_DEFAULT_LOG_LEVEL)
|
335
|
+
_logger_no_user_data.configure(default_log_level=_DEFAULT_LOG_LEVEL)
|
336
|
+
_configure_requests_certificates()
|
337
|
+
|
338
|
+
set_api_base_url(biolib.utils.load_base_url_from_env())
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from .typing import Literal, NotRequired, TypedDict
|
2
|
+
|
3
|
+
|
4
|
+
class ResourceVersionDict(TypedDict):
|
5
|
+
uuid: str
|
6
|
+
semantic_version: str
|
7
|
+
state: Literal['published', 'unpublished']
|
8
|
+
created_at: str
|
9
|
+
git_branch_name: NotRequired[str]
|
10
|
+
|
11
|
+
|
12
|
+
class ResourceVersionDetailedDict(ResourceVersionDict):
|
13
|
+
pass
|
@@ -5,3 +5,6 @@ from typing import * # noqa:F403 pylint: disable=wildcard-import, unused-wildca
|
|
5
5
|
|
6
6
|
if sys.version_info < (3, 8): # noqa: UP036
|
7
7
|
from typing_extensions import Literal, TypedDict # pylint: disable=unused-import
|
8
|
+
|
9
|
+
if sys.version_info < (3, 11): # noqa: UP036
|
10
|
+
from typing_extensions import NotRequired # pylint: disable=unused-import
|
@@ -108,7 +108,7 @@ class BioLibApp:
|
|
108
108
|
(utils.STREAM_STDOUT or stream_logs)
|
109
109
|
and (self._app_version.get('main_output_file') or self._app_version.get('stdout_render_type') == 'text')
|
110
110
|
)
|
111
|
-
job._stream_logs(enable_print=enable_print)
|
111
|
+
job._stream_logs(enable_print=enable_print) # pylint: disable=protected-access
|
112
112
|
|
113
113
|
if check:
|
114
114
|
exit_code = job.get_exit_code()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pybiolib"
|
3
|
-
version = "1.2.
|
3
|
+
version = "1.2.561"
|
4
4
|
description = "BioLib Python Client"
|
5
5
|
readme = "PYPI_README.md"
|
6
6
|
license = "MIT"
|
@@ -32,7 +32,7 @@ importlib-metadata = ">=1.6.1"
|
|
32
32
|
python = "^3.6.3"
|
33
33
|
pyyaml = ">=5.3.1"
|
34
34
|
rich = ">=12.4.4"
|
35
|
-
|
35
|
+
typing-extensions = { version = ">=4.1.0", python = "<3.11" }
|
36
36
|
|
37
37
|
# Optional dependencies included in the below `extras`
|
38
38
|
flask = { version = ">=2.0.1", optional = true }
|
@@ -1,145 +0,0 @@
|
|
1
|
-
# Imports to hide
|
2
|
-
import os
|
3
|
-
from urllib.parse import urlparse as _urlparse
|
4
|
-
|
5
|
-
from biolib import typing_utils as _typing_utils
|
6
|
-
from biolib.app import BioLibApp as _BioLibApp
|
7
|
-
# TODO: Fix ignore of type
|
8
|
-
from biolib.app.search_apps import search_apps # type: ignore
|
9
|
-
from biolib.biolib_errors import BioLibError
|
10
|
-
from biolib.biolib_logging import logger as _logger, logger_no_user_data as _logger_no_user_data
|
11
|
-
from biolib.experiments.experiment import Experiment
|
12
|
-
from biolib.biolib_api_client import BiolibApiClient as _BioLibApiClient, App
|
13
|
-
from biolib.jobs import Job as _Job
|
14
|
-
from biolib import user as _user
|
15
|
-
from biolib.typing_utils import List, Optional, cast as _cast
|
16
|
-
from biolib._data_record.data_record import DataRecord as _DataRecord
|
17
|
-
|
18
|
-
import biolib.api
|
19
|
-
import biolib.app
|
20
|
-
import biolib.cli
|
21
|
-
import biolib.sdk
|
22
|
-
import biolib.utils
|
23
|
-
|
24
|
-
|
25
|
-
# ------------------------------------ Function definitions for public Python API ------------------------------------
|
26
|
-
|
27
|
-
def call_cli() -> None:
|
28
|
-
biolib.cli.cli()
|
29
|
-
|
30
|
-
|
31
|
-
def load(uri: str) -> _BioLibApp:
|
32
|
-
return _BioLibApp(uri)
|
33
|
-
|
34
|
-
|
35
|
-
def search(
|
36
|
-
search_query: Optional[str] = None,
|
37
|
-
team: Optional[str] = None,
|
38
|
-
count: int = 100,
|
39
|
-
) -> List[str]:
|
40
|
-
apps: List[str] = search_apps(search_query, team, count)
|
41
|
-
return apps
|
42
|
-
|
43
|
-
|
44
|
-
def get_job(job_id: str, job_token: Optional[str] = None) -> _Job:
|
45
|
-
return _Job.create_from_uuid(uuid=job_id, auth_token=job_token)
|
46
|
-
|
47
|
-
|
48
|
-
def get_data_record(uri: str) -> _DataRecord:
|
49
|
-
return _DataRecord.get_by_uri(uri)
|
50
|
-
|
51
|
-
|
52
|
-
def fetch_jobs(count: int = 25, status: Optional[str] = None) -> List[_Job]:
|
53
|
-
return _Job.fetch_jobs(count, status)
|
54
|
-
|
55
|
-
|
56
|
-
def fetch_data_records(uri: Optional[str] = None, count: Optional[int] = None) -> List[_DataRecord]:
|
57
|
-
return _DataRecord.fetch(uri, count)
|
58
|
-
|
59
|
-
|
60
|
-
def get_experiment(uri: Optional[str] = None, name: Optional[str] = None) -> Experiment:
|
61
|
-
if (not uri and not name) or (uri and name):
|
62
|
-
raise ValueError('Must provide either uri or name')
|
63
|
-
|
64
|
-
return Experiment.get_by_uri(uri=_cast(str, uri or name))
|
65
|
-
|
66
|
-
|
67
|
-
def show_jobs(count: int = 25) -> None:
|
68
|
-
_Job.show_jobs(count=count)
|
69
|
-
|
70
|
-
|
71
|
-
def show_experiments(count: int = 25) -> None:
|
72
|
-
Experiment.show_experiments(count=count)
|
73
|
-
|
74
|
-
|
75
|
-
def sign_in() -> None:
|
76
|
-
_user.sign_in()
|
77
|
-
|
78
|
-
|
79
|
-
def sign_out() -> None:
|
80
|
-
_user.sign_out()
|
81
|
-
|
82
|
-
|
83
|
-
def login() -> None:
|
84
|
-
sign_in()
|
85
|
-
|
86
|
-
|
87
|
-
def logout() -> None:
|
88
|
-
sign_out()
|
89
|
-
|
90
|
-
|
91
|
-
def set_api_base_url(api_base_url: str) -> None:
|
92
|
-
_BioLibApiClient.initialize(base_url=api_base_url)
|
93
|
-
biolib.utils.BIOLIB_BASE_URL = api_base_url
|
94
|
-
biolib.utils.BIOLIB_SITE_HOSTNAME = _urlparse(api_base_url).hostname
|
95
|
-
biolib.utils.BASE_URL_IS_PUBLIC_BIOLIB = api_base_url.endswith('biolib.com') or (
|
96
|
-
os.environ.get('BIOLIB_ENVIRONMENT_IS_PUBLIC_BIOLIB', '').upper() == 'TRUE'
|
97
|
-
)
|
98
|
-
|
99
|
-
|
100
|
-
def set_base_url(base_url: str) -> None:
|
101
|
-
return set_api_base_url(base_url)
|
102
|
-
|
103
|
-
|
104
|
-
def set_api_token(api_token: str) -> None:
|
105
|
-
api_client = _BioLibApiClient.get()
|
106
|
-
api_client.sign_in_with_api_token(api_token)
|
107
|
-
|
108
|
-
|
109
|
-
def set_log_level(level: _typing_utils.Union[str, int]) -> None:
|
110
|
-
_logger.setLevel(level)
|
111
|
-
_logger_no_user_data.setLevel(level)
|
112
|
-
|
113
|
-
|
114
|
-
def _configure_requests_certificates():
|
115
|
-
if os.getenv('REQUESTS_CA_BUNDLE'):
|
116
|
-
if not os.getenv('SSL_CERT_FILE'):
|
117
|
-
# set SSL_CERT_FILE to urllib use same certs
|
118
|
-
os.environ['SSL_CERT_FILE'] = os.getenv('REQUESTS_CA_BUNDLE')
|
119
|
-
return # don't change REQUESTS_CA_BUNDLE if manually configured
|
120
|
-
|
121
|
-
certs_to_check = [
|
122
|
-
'/etc/ssl/certs/ca-certificates.crt',
|
123
|
-
'/etc/pki/tls/certs/ca-bundle.crt',
|
124
|
-
'/etc/ssl/ca-bundle.pem',
|
125
|
-
'/etc/pki/tls/cacert.pem',
|
126
|
-
'/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem',
|
127
|
-
'/etc/ssl/cert.pem',
|
128
|
-
]
|
129
|
-
|
130
|
-
for cert in certs_to_check:
|
131
|
-
if os.path.exists(cert):
|
132
|
-
os.environ['REQUESTS_CA_BUNDLE'] = cert
|
133
|
-
if not os.getenv('SSL_CERT_FILE'):
|
134
|
-
os.environ['SSL_CERT_FILE'] = cert
|
135
|
-
return
|
136
|
-
|
137
|
-
|
138
|
-
# -------------------------------------------------- Configuration ---------------------------------------------------
|
139
|
-
__version__ = biolib.utils.BIOLIB_PACKAGE_VERSION
|
140
|
-
_DEFAULT_LOG_LEVEL = 'INFO' if biolib.utils.IS_RUNNING_IN_NOTEBOOK else 'WARNING'
|
141
|
-
_logger.configure(default_log_level=_DEFAULT_LOG_LEVEL)
|
142
|
-
_logger_no_user_data.configure(default_log_level=_DEFAULT_LOG_LEVEL)
|
143
|
-
_configure_requests_certificates()
|
144
|
-
|
145
|
-
set_api_base_url(biolib.utils.load_base_url_from_env())
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/_internal/data_record/remote_storage_endpoint.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/docker_executor.py
RENAMED
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/docker_types.py
RENAMED
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/executors/tars/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/job_worker/utilization_reporter_thread.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pybiolib-1.2.520 → pybiolib-1.2.561}/biolib/compute_node/webserver/gunicorn_flask_application.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|