Skip to main content

A Flask extension for integrating with Supabase

Project description

Flask-Supabase Extension

The Flask-Supabase extension provides a simple and intuitive way to integrate Supabase into your Flask applications. With minimal setup, you can start leveraging the power of Supabase in your Flask projects, whether it's for database operations, authentication, or any other feature supported by Supabase.

Features

  • Easy integration of Supabase into Flask applications.
  • Automatic management of Supabase API keys and URLs.
  • Efficient handling of Supabase client instances throughout the application lifecycle.

Installation

Install Flask-Supabase using pip:

pip install flask-supabase

Quick Start

  1. Set up your Flask application

First, ensure you have Flask installed. If not, you can install it using pip:

pip install Flask

Then, set up a basic Flask application:

from flask import Flask
app = Flask(__name__)
  1. Configure the Flask-Supabase extension

Import and initialize the Supabase extension, passing your Flask app object to it. Don't forget to set the SUPABASE_URL and SUPABASE_KEY in your app's configuration:

from flask_supabase import Supabase

app.config['SUPABASE_URL'] = 'your_supabase_project_url'
app.config['SUPABASE_KEY'] = 'your_supabase_api_key'
supabase_extension = Supabase(app)

Alternatively, if you are using a factory function to create your Flask app, you can set up the Supabase extension like this:

supabase_extension = Supabase()

def create_app():
    app = Flask(__name__)
    app.config['SUPABASE_URL'] = 'your_supabase_project_url'
    app.config['SUPABASE_KEY'] = 'your_supabase_api_key'
    supabase_extension.init_app(app)
    return app
  1. Use the Supabase client in your application

Now, you can access the Supabase client in your route handlers using supabase_extension.client. Here's an example of how to perform a database operation with Supabase:

@app.route('/users')
def get_users():
    response = supabase_extension.client.from_('users').select('*').execute()
    return response.data

Documentation

For more information on Supabase and its capabilities, visit Supabase documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a pull request.

Support

If you have any questions or encounter any issues, please open an issue on the project's GitHub page.

Acknowledgements

This project is not officially associated with Supabase. All trademarks are the property of their respective owners.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flask_supabase-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_supabase-0.3.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file flask_supabase-0.3.0.tar.gz.

File metadata

  • Download URL: flask_supabase-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.0

File hashes

Hashes for flask_supabase-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cc411d5178ed70e0eda877b9f6b7a4aa83300985dd0d4962fa6e7ea811fdc928
MD5 16a77d0194a3519d2d5f8eb57e491690
BLAKE2b-256 0c04877da2c9461ef48b9aa14fdc412ced19dcb9d309da366c33d8905ba340fc

See more details on using hashes here.

File details

Details for the file flask_supabase-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_supabase-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb1c2a0c57695610eef0cbb1177aea456e590799558dc32fd597a31ce4c0f82f
MD5 dc2c1bd4afe1cbe66b1fec77e177f3fa
BLAKE2b-256 0a91f373675dc83e6825d564eb5c26c8c0dd46dfb6428332daaed3662f435014

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page