pypath.inputs.credentials.credentials§

pypath.inputs.credentials.credentials(*args: tuple[str, str], resource: str | None = None, from_file: str | None = None, **kwargs: dict[str, str]) dict[source]§

Credentials required for restricted access resources.

Args
args:

Two strings: a user name and password. If only one provided, it is assumed to be a user name; if more provided, apart from the first two, the rest will be ignored.

resource:

Name of the resource. If the key <resource>_credentials exists in the module settings, its value will be returned as credentials.

from_file:

Path to a file or name of a file that is located in the module’s default secrets directory.

kwargs:

Custom key-value pairs, will be returned unchanged. This is the way to explicitely provide user and password, and any further fields.

Returns

A dictionary with the credentials. Raises RuntimeError if credentials not provided by any of the available ways.