Looking to download bulk files form PermID.org. Do I need my token? If so, any idea on the python call to do this? using requests maybe?
You need to know a file name and access token.
I got the source code from StackOverflow.
import requests import shutil def download_file(url): local_filename = url.split('/')[-1] local_filename = local_filename.split('?')[0] print("Save: ", local_filename) r = requests.get(url, stream=True) with open(local_filename, 'wb') as f: shutil.copyfileobj(r.raw, f) return local_filename access_token = "<access token>" download_file("https://permid.org/sfiles/bulkDownload/OpenPermID-bulk-organization-20190310_072837.ttl.gz?access-token="+access_token)
The above code will download the OpenPermID-bulk-organization-20190310_072837.ttl.gz file.
I will contact the Open PermId support team to verify if we have an interface to retrieve a list of files.
You can use the following URL to get a list of files.
https://permid.org/api/bulkDownload/metadata?access-token=<access_token>
Good. Any thoughts on how to get the changing "
072837
" in the link?
download_file("https://permid.org/sfiles/bulkDownload/OpenPermID-bulk-organization-20190310_072837.ttl.gz?access-token="+access_token)
Hi, I can't get this:
https://permid.org/api/bulkDownload/metadata?access-token=<access_token>;
to work... when using my token. can you give a specific example? ie do i use the < >, I have tried with and without and it does not work...