Hi,
I am a validated Synapse Account Level, with data access approved for MJFF Levodopa data. When I run the below code, I get the following error:
SynapseHTTPError: 403 Client Error: You lack READ access to the requested entity.
My understanding I should be able to download the data programatically?
Thank you
Elias
import os
import synapseclient as sc
synapse_username = 'my-email'
synapse_password = 'my-password'
syn = sc.login(synapse_username, synapse_password)
query = syn.tableQuery("SELECT * FROM syn20681931")
exported_table = query.asDataFrame()
if not os.path.isdir('files'):
os.mkdir("files")
[syn.get(x, downloadLocation = "./files") for x in exported_table.head(1).data_file_handle_id]
Created by Elias Abou Zeid eabouzeid Hi Elias, you are seeing that error because you are trying to use a method for getting file entities on file handles. You will find some sample python code for downloading the data on [this wiki page](https://www.synapse.org/#!Synapse:syn20681023/wiki/594679) under the "A. Data Access through the R or Python Clients" section.
While it may be tempting to instead iterate over the `source_file` column with `syn.get` since this column _is_ a file entity, those file entities point at different file handles (and thus potentially different data) than the file handles in the `data_file_handle_id` column.
Be aware that the `syn.downloadTableColumns` calls will take some time, and you may want to initially query a limited number of results (e.g., `syn.tableQuery("SELECT * FROM syn20681931 LIMIT 10"`) so that you can use a subset of the data right away while you download the entire dataset in the background. Yes, I do see the rows and the .txt data files under 'data_file_handle_id' and I can manually download the .txt files. Hi Elias-
Do you see the data when you navigate to this page? https://www.synapse.org/#!Synapse:syn20681931/tables/
Drop files to upload
SynapseHTTPError: 403 Client Error: You lack READ access to the requested entity. page is loading…