Supabase Storage client for Python.
Project description
Storage-py
Python Client library to interact with Supabase Storage.
How to use
As it takes some effort to get the headers. We suggest that you use the storage functionality through the main Supabase Python Client
from storage3 import create_client
url = "https://<your_supabase_id>.supabase.co/storage/v1"
key = "<your api key>"
headers = {"apiKey": key, "Authorization": f"Bearer {key}"}
# pass in is_async=True to create an async client
storage_client = create_client(url, headers, is_async=False)
storage_client.list_buckets()
Uploading files
When uploading files, make sure to set the correct mimetype by using the file_options
argument:
storage_client.from_("bucket").upload("/folder/file.png", file_object, {"content-type": "image/png"})
If no mime type is given, the default text/plain
will be used.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
storage3-0.7.6.tar.gz
(9.3 kB
view hashes)
Built Distribution
storage3-0.7.6-py3-none-any.whl
(16.0 kB
view hashes)