Skip to content

supabase/storage-py

Folders and files

NameName
Last commit message
Last commit date
Jan 29, 2025
Sep 29, 2023
May 14, 2024
Jan 29, 2025
Jan 29, 2025
Dec 24, 2021
Apr 29, 2022
Dec 24, 2021
May 14, 2024
Jan 29, 2025
Jan 29, 2025
Dec 24, 2021
Aug 20, 2024
Jan 2, 2024
Jan 23, 2025
Jun 6, 2023
Mar 29, 2025
Mar 29, 2025
Aug 15, 2024

Repository files navigation

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.