# 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/a8/af/94cd4925c8a80b4c06bdef60226c04566973f6e2982957d2eabeecb2d5ca/storage3-0.8.2.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.8.2",
"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": "",
"digests": {
"blake2b_256": "c8677d281ba69b3ba3359f528bb0a1cac9d87896938d80119451123e829b3820",
"md5": "3b4ecaa2761735c41ef43b2acea0997e",
"sha256": "f2e995b18c77a2a9265d1a33047d43e4d6abb11eb3ca5067959f68281c305de3"
},
"downloads": -1,
"filename": "storage3-0.8.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b4ecaa2761735c41ef43b2acea0997e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 16230,
"upload_time": "2024-10-18T07:05:38",
"upload_time_iso_8601": "2024-10-18T07:05:38.408142Z",
"url": "https://files.pythonhosted.org/packages/c8/67/7d281ba69b3ba3359f528bb0a1cac9d87896938d80119451123e829b3820/storage3-0.8.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a8af94cd4925c8a80b4c06bdef60226c04566973f6e2982957d2eabeecb2d5ca",
"md5": "80ce20fcbab325c349cda8d390ba4da8",
"sha256": "db05d3fe8fb73bd30c814c4c4749664f37a5dfc78b629e8c058ef558c2b89f5a"
},
"downloads": -1,
"filename": "storage3-0.8.2.tar.gz",
"has_sig": false,
"md5_digest": "80ce20fcbab325c349cda8d390ba4da8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 9041,
"upload_time": "2024-10-18T07:05:40",
"upload_time_iso_8601": "2024-10-18T07:05:40.219796Z",
"url": "https://files.pythonhosted.org/packages/a8/af/94cd4925c8a80b4c06bdef60226c04566973f6e2982957d2eabeecb2d5ca/storage3-0.8.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-18 07:05:40",
"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"
}