Open thomasborgen opened 2 years ago
Maybe its not that straight forward. We decided not to call the blobs in storage bucket for blobs, but for files. Which kind of led to the names upload_file and download file.
Not a 100% sure how to move forward. My issue when i looked into changing it was this:
def download(storage_bucket_name, filename): ...
def download_to_file(storage_bucket_name, filename, local_filename): ...
The argument naming gets a bit weird 😓
So then maybe we should change the argument names aswell. But if we do that we should create a consistent naming standard and we should probably just follow what google does... Calling a blob a blob is probably just the easiest way forward where a blob is data in a storage bucket and a file is data stored in a conventional way.
Is your feature request related to a problem? Please describe.
download_file
andupload_file
function names are misleading.The problem with
download_file
is that while it does consume a storage bucket blob, it does not write to a file, it just returns bytes. The problem withupload_file
is that from the name one would expect the input to the function to be a filename, but it is actually bytes.Describe the solution you'd like
Clearer api.
upload
- inputdata: str | bytes
upload_from_file
- inputfilename: str
download
- returnsstr | bytes
download_to_file
- returnfilename: str
or absolute path to the file.or have string and bytes spesific functions as well. but that might be a bit overkill.