# 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_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:
```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.
Raw data
{
"_id": null,
"home_page": "https://supabase.github.io/storage-py",
"name": "storage3",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Joel Lee",
"author_email": "joel@joellee.org",
"download_url": "https://files.pythonhosted.org/packages/ac/25/83eb4e4612dc07a3bb3cab96253c9c83752d4816f2cf38aa832dfb8d8813/storage3-0.11.3.tar.gz",
"platform": null,
"description": "# Storage-py\n\nPython Client library to interact with Supabase Storage.\n\n\n\n## How to use\n\nAs 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)\n\n\n```python3\nfrom storage3 import create_client\n\nurl = \"https://<your_supabase_id>.supabase.co/storage/v1\"\nkey = \"<your api key>\"\nheaders = {\"apiKey\": key, \"Authorization\": f\"Bearer {key}\"}\n\n# pass in is_async=True to create an async client\nstorage_client = create_client(url, headers, is_async=False)\n\nstorage_client.list_buckets()\n```\n\n### Uploading files\nWhen uploading files, make sure to set the correct mimetype by using the `file_options` argument:\n```py\nstorage_client.from_(\"bucket\").upload(\"/folder/file.png\", file_object, {\"content-type\": \"image/png\"})\n```\nIf no mime type is given, the default `text/plain` will be used.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Supabase Storage client for Python.",
"version": "0.11.3",
"project_urls": {
"Documentation": "https://supabase.github.io/storage-py",
"Homepage": "https://supabase.github.io/storage-py",
"Repository": "https://github.com/supabase/storage-py"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c98dff89f85c4b48285ac7cddf0fafe5e55bb3742d374672b2fbd2627c213fa6",
"md5": "03f2b7574210aa5ded1d39cd8c2f328c",
"sha256": "090c42152217d5d39bd94af3ddeb60c8982f3a283dcd90b53d058f2db33e6007"
},
"downloads": -1,
"filename": "storage3-0.11.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "03f2b7574210aa5ded1d39cd8c2f328c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 17831,
"upload_time": "2025-01-29T20:43:16",
"upload_time_iso_8601": "2025-01-29T20:43:16.075121Z",
"url": "https://files.pythonhosted.org/packages/c9/8d/ff89f85c4b48285ac7cddf0fafe5e55bb3742d374672b2fbd2627c213fa6/storage3-0.11.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ac2583eb4e4612dc07a3bb3cab96253c9c83752d4816f2cf38aa832dfb8d8813",
"md5": "29034a965d43c0b9335991770495c6d9",
"sha256": "883637132aad36d9d92b7c497a8a56dff7c51f15faf2ff7acbccefbbd5e97347"
},
"downloads": -1,
"filename": "storage3-0.11.3.tar.gz",
"has_sig": false,
"md5_digest": "29034a965d43c0b9335991770495c6d9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 9930,
"upload_time": "2025-01-29T20:43:18",
"upload_time_iso_8601": "2025-01-29T20:43:18.392083Z",
"url": "https://files.pythonhosted.org/packages/ac/25/83eb4e4612dc07a3bb3cab96253c9c83752d4816f2cf38aa832dfb8d8813/storage3-0.11.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-29 20:43:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "supabase",
"github_project": "storage-py",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "storage3"
}