lunapi.bdc¶
Small Python client for files stored in a Gen3/BioData Catalyst commons.
The client deliberately deals in file-index records rather than depending on
the external gen3-client executable. This keeps it usable by notebooks
and desktop applications alike while allowing each Gen3 deployment to supply
its own endpoint and project identifier.
Attributes¶
Classes¶
Authenticated file browser/downloader for a Gen3 commons. |
Module Contents¶
- class lunapi.bdc.BDCClient(endpoint=_DEFAULT_ENDPOINT, key_id=None, api_key=None, project=None, session=None, token=None)[source]¶
Authenticated file browser/downloader for a Gen3 commons.
- Parameters:
endpoint (str) – Base URL of the Gen3 commons.
key_id (str) – API-key pair created by the commons Profile page.
api_key (str) – API-key pair created by the commons Profile page.
project (str, optional) – Project identifier used by
files()when supplied.session (requests.Session, optional) – Injectable HTTP session for tests or callers with custom TLS setup.
- files(project=None) list[dict][source]¶
Return normalized file-index records for project.
Gen3 deployments expose slightly different metadata keys. The normalizer accepts the common indexd fields and preserves the raw record under
rawfor callers needing deployment-specific data.
- download(record: dict, destination: str | os.PathLike, force=False, progress: Callable[[int, int], None] | None = None) pathlib.Path[source]¶
Download one normalized index record to destination.
Existing files are skipped unless force is true. A
Rangeheader resumes a partial file when the server supports it.