fetch_single_file#

biotite.database.entrez.fetch_single_file(uids: Iterable[str], file_name: str | PathLike[str] | None, db_name: str, ret_type: str, ret_mode: Literal['text', 'xml', 'json', 'asn.1', 'html'] = 'text', overwrite: bool = False) → Path | StringIO[source]#

Almost the same as fetch(), but the data for the given UIDs will be stored in a single file.

Parameters:
uidsiterable object of str

A list of UIDs of the file(s) to be downloaded.

file_namestr or PathLike or None

The file path, including file name, to the target file. If None, the file content is stored in a StringIO object.

db_namestr:

E-utility or common database name.

ret_typestr

Retrieval type.

ret_modestr, optional

Retrieval mode.

overwritebool, optional

If false, the file is only downloaded, if no file with the same name already exists.

Returns:
filePath or StringIO

The path of the downloaded file. If file_name is None, the file content is stored in a StringIO object.

Warning

Even if you give valid input to this function, in rare cases the database might return no or malformed data to you. In these cases the request should be retried. When the issue occurs repeatedly, the error is probably in your input.

See also

fetch

Fetch one or multiple entries as separate files.