Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supabase/storage-py
https://github.com/supabase/storage-py
supabase supabase-storage
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/supabase/storage-py
- Owner: supabase
- License: mit
- Created: 2021-12-24T16:20:33.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-09T00:23:15.000Z (18 days ago)
- Last Synced: 2025-01-13T07:04:14.886Z (14 days ago)
- Topics: supabase, supabase-storage
- Language: Python
- Homepage: https://supabase-community.github.io/storage-py/
- Size: 1.12 MB
- Stars: 47
- Watchers: 18
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# 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](https://github.com/supabase-community/supabase-py)
```python3
from storage3 import create_clienturl = "https://.supabase.co/storage/v1"
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:
```py
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.