biotite.database.rcsb.fetch(pdb_ids, format, target_path, overwrite=False, verbose=False)[source]

Download structure files from the RCSB PDB in various formats.

This function requires an internet connection.

pdb_idsstr or iterable object of str

A single PDB ID or a list of PDB IDs of the structure(s) to be downloaded .


The format of the files to be downloaded. ‘pdb’, ‘pdbx’, ‘cif’ or ‘mmtf’ are allowed.


The target directory of the downloaded files.

overwritebool, optional

If true, existing files will be overwritten. Otherwise the respective file will only be downloaded if the file does not exist yet in the specified target directory. (Default: False)

verbose: bool, optional

If true, the function will output the download progress. (Default: False)

filesstr or list of str

The file path(s) to the downloaded files. If a single string (a single ID) was given in pdb_ids, a single string is returned. If a list (or other iterable object) was given, a list of strings is returned.


>>> import os.path
>>> files = fetch(["1l2y", "3o5r"], "cif", path_to_directory)
>>> print([os.path.basename(file) for file in files])
['1l2y.cif', '3o5r.cif']