Code Monkey home page Code Monkey logo

storage-py's Introduction

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.

storage-py's People

Contributors

j0 avatar dependabot[bot] avatar anand2312 avatar dreinon avatar silentworks avatar actions-user avatar dishwad avatar cyber-phys avatar siegandy avatar asciidiego avatar github-actions[bot] avatar justinbarak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.