Hi all,
How would you suggest I return a CSV media object back to my local computer via Uplink? I know there are a few ways to return media, but I’m wondering if I’m missing something more straight forward.
Once I connect with Uplink, I’m able to bring the media back onto my local computer with
my_media=app_tables.my_table.get(column='value')['media_column']
But then I’m having to use get_bytes
and convert the bytes into a DataFrame:
my_media=app_tables.my_table.get(column='value')['media_column']
my_bytes=my_media.get_bytes()
my_string = str(my_bytes, 'utf-8')
df = pd.read_csv(pd.compat.StringIO(my_string),
names=["header1", "header2", "header3"])
I also tried an HTTP endpoint. This worked well but I now have to deal with authentication and checking credentials so that no one else can download my data. When I type in my HTTP path in the browser the data comes back perfectly as a CSV; however, when I use requests
module to access that endpoint programatically, I still have to decode the content with response.content.decode('utf-8')
, and coerce into a DataFrame.
This is not bad, but am I missing a cleaner approach?
Allan