storage3


Namestorage3 JSON
Version 0.10.0 PyPI version JSON
download
home_pagehttps://supabase.github.io/storage-py
SummarySupabase Storage client for Python.
upload_time2024-11-22 16:25:52
maintainerNone
docs_urlNone
authorJoel Lee
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # 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/a4/45/76b84479152c0a80d0050d84892203e3fba06c7b8f869bae585c2672b77b/storage3-0.10.0.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.10.0",
    "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": "77a21886ced273d1e033248d42037c798799b4333ea1c5ca3051f567269b031f",
                "md5": "d376ac98a3a35eb9762dadc5c7cb469a",
                "sha256": "66d44d95ba1c31305fdef0bf5ca6a7ef6fd41baadbdaa922e338c294de489339"
            },
            "downloads": -1,
            "filename": "storage3-0.10.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d376ac98a3a35eb9762dadc5c7cb469a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 16719,
            "upload_time": "2024-11-22T16:25:51",
            "upload_time_iso_8601": "2024-11-22T16:25:51.419458Z",
            "url": "https://files.pythonhosted.org/packages/77/a2/1886ced273d1e033248d42037c798799b4333ea1c5ca3051f567269b031f/storage3-0.10.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a44576b84479152c0a80d0050d84892203e3fba06c7b8f869bae585c2672b77b",
                "md5": "c78a1e03507fb911870cdb82c5ee2a4b",
                "sha256": "d062c6993660dad199e76c02742463c11ebb70726343b98a1cdcb4f4ce344c67"
            },
            "downloads": -1,
            "filename": "storage3-0.10.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c78a1e03507fb911870cdb82c5ee2a4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 9286,
            "upload_time": "2024-11-22T16:25:52",
            "upload_time_iso_8601": "2024-11-22T16:25:52.878229Z",
            "url": "https://files.pythonhosted.org/packages/a4/45/76b84479152c0a80d0050d84892203e3fba06c7b8f869bae585c2672b77b/storage3-0.10.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-22 16:25:52",
    "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"
}
        
Elapsed time: 4.80588s