ynput / ayon-python-api

Apache License 2.0
8 stars 3 forks source link

Download and Upload using IO stream #154

Closed iLLiCiTiT closed 2 months ago

iLLiCiTiT commented 2 months ago

Description

Added option to download file to BytesIO and upload file from BytesIO.

Additional information

Sometimes it might be handy to be able to download content from server without storing it to a file but only to memory, or upload file from memory.

BigRoy commented 2 months ago

Side note is that ayon-python-api on pypi seems listed as Python 2 and Python 3 even though this change technically makes it Python 3.2+ compatible.

iLLiCiTiT commented 2 months ago

Side note is that ayon-python-api on pypi seems listed as Python 2 and Python 3 even though this change technically makes it Python 3.2+ compatible.

Good point will do PR changing it.

EDITED: PR https://github.com/ynput/ayon-python-api/pull/156

kalisp commented 2 months ago

Code looks good, but I didn't know how to test it. I wanted to mock downloading dependency package to BytesIO and then saving it: image

but it failed: image

Maybe its just my messed up test.