Skip to content

taps.apps.docking.data

Data download CLI for the docking app.

download

download(directory: Path | str) -> None

Download docking app files.

Source code in taps/apps/docking/data.py
def download(directory: pathlib.Path | str) -> None:
    """Download docking app files."""
    directory = pathlib.Path(directory)
    directory.mkdir(parents=True, exist_ok=True)
    for name, source in FILES.items():
        output = directory / name
        with open(output, 'wb') as f:
            content = requests.get(source, stream=True).content
            f.write(content)
        print(f'Downloaded {output}')

main

main(argv: Sequence[str] | None = None) -> int

Data download CLI.

Source code in taps/apps/docking/data.py
def main(argv: Sequence[str] | None = None) -> int:
    """Data download CLI."""
    argv = argv if argv is not None else sys.argv[1:]
    parser = argparse.ArgumentParser(
        description='Protein docking data downloader',
    )
    parser.add_argument(
        '-o',
        '--output',
        required=True,
        help='Output directory for downloaded files',
    )
    args = parser.parse_args(argv)

    download(args.output)

    return 0