trx.fetcher =========== .. py:module:: trx.fetcher Attributes ---------- .. autoapisummary:: trx.fetcher.TEST_DATA_REPO trx.fetcher.TEST_DATA_TAG trx.fetcher.TEST_DATA_API_URL trx.fetcher.TEST_DATA_BASE_URL Functions --------- .. autoapisummary:: trx.fetcher.get_home trx.fetcher.get_testing_files_dict trx.fetcher.md5sum trx.fetcher.sha256sum trx.fetcher.fetch_data Module Contents --------------- .. py:data:: TEST_DATA_REPO :value: 'tee-ar-ex/trx-test-data' .. py:data:: TEST_DATA_TAG :value: 'v0.1.0' .. py:data:: TEST_DATA_API_URL :value: 'https://api.github.com/repos/tee-ar-ex/trx-test-data/releases/tags/v0.1.0' .. py:data:: TEST_DATA_BASE_URL :value: 'https://github.com/tee-ar-ex/trx-test-data/releases/download/v0.1.0' .. py:function:: get_home() Set a user-writeable file-system location to put files .. !! processed by numpydoc !! .. py:function:: get_testing_files_dict() Get dictionary linking zip file to their GitHub release URL & checksums. Assets are hosted under the v0.1.0 release of tee-ar-ex/trx-test-data. If URLs change, check TEST_DATA_API_URL to discover the latest asset locations. .. !! processed by numpydoc !! .. py:function:: md5sum(filename) Compute one md5 checksum for a file .. !! processed by numpydoc !! .. py:function:: sha256sum(filename) Compute one sha256 checksum for a file .. !! processed by numpydoc !! .. py:function:: fetch_data(files_dict, keys=None) Downloads files to folder and checks their md5 checksums :Parameters: **files_dict** : dictionary 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. .. !! processed by numpydoc !!