trx.fetcher#

Functions#

get_home()

Set a user-writeable file-system location to put files

get_testing_files_dict()

Get dictionary linking zip file to their Figshare URL & MD5SUM

md5sum(filename)

Compute one md5 checksum for a file

fetch_data(files_dict[, keys])

Downloads files to folder and checks their md5 checksums

Module Contents#

trx.fetcher.get_home()[source]#

Set a user-writeable file-system location to put files

trx.fetcher.get_testing_files_dict()[source]#

Get dictionary linking zip file to their Figshare URL & MD5SUM

trx.fetcher.md5sum(filename)[source]#

Compute one md5 checksum for a file

trx.fetcher.fetch_data(files_dict, keys=None)[source]#

Downloads files to folder and checks their md5 checksums

Parameters:
files_dictdictionary

For each file in files_dict the value should be (url, md5). The file will be downloaded from url, if the file does not already exist or if the file exists but the md5 checksum does not match. Zip files are automatically unzipped and its content* are md5 checked.

Raises:
ValueError

Raises if the md5 checksum of the file does not match the expected value. The downloaded file is not deleted when this error is raised.