Skip to main content

supabase-py with async synax

Project description

supabase-py-async

License: MIT CI Python Version

Downloads Open Issues Pull Requests Contributors Code Size License

Supabase client for Python with Async support. This project is an asynchronous variant of supabase-py and mirrors the design of supabase-js.

Status

We are currently in Public Alpha. Updates will be released as the library matures.

Installation

PyPi Installation

To install the package for Python 3.7 and above:

# with pip
pip install supabase-py-async

# with poetry
poetry add supabase-py-async

Local Installation

For local development, clone this repo and install in Development mode with pip install -e.

Async Usage

This client is designed to be used asynchronously. Below are some examples on how to use it.

Initialize Supabase Client

import os
import asyncio
from supabase_py_async import create_client, AsyncClient

url: str = os.environ.get("SUPABASE_URL")

key: str = os.environ.get("SUPABASE_KEY")

supabase: AsyncClient = create_client(url, key)

Async Data Operations

async def data_operations():
  # Insert
  insert_data = await supabase.table("countries").insert({"name": "Germany"}).execute()

  # Select
  select_data = await supabase.table("countries").select("*").eq("country", "IL").execute()

  # Update
  update_data = await supabase.table("countries").update({"country": "Indonesia", "capital_city": "Jakarta"}).eq("id",
                                                                                                                 1).execute()

  # Delete
  delete_data = await supabase.table("countries").delete().eq("id", 1).execute()


asyncio.run(data_operations())

Async Authentication

async def async_auth():
  random_email: str = "email@example.com"
  random_password: str = "supersecurepassword"
  user = await supabase.auth.sign_up(email=random_email, password=random_password)


asyncio.run(async_auth())

See Supabase Docs for a full list of examples.

Contributions

Feel free to contribute to this project. We are in the early stages and appreciate any help.

Note

the README.md file is generated by GPT4 from the supabase-py's README.md

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

supabase_py_async-2.0.3.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

supabase_py_async-2.0.3-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file supabase_py_async-2.0.3.tar.gz.

File metadata

  • Download URL: supabase_py_async-2.0.3.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Windows/10

File hashes

Hashes for supabase_py_async-2.0.3.tar.gz
Algorithm Hash digest
SHA256 8e36b8bc2790ecd2cba5d38d53d27df377dee6c2a55f4f7e5b5a933b3384236c
MD5 922f8effa174d895d0fa5872f60ba006
BLAKE2b-256 25c47e420894c12fdc905adf750846edd5bebe4f492cf5a49ccb5765c587cb69

See more details on using hashes here.

File details

Details for the file supabase_py_async-2.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for supabase_py_async-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0feb52e9a824415756c1ca53f1e8f64a973eb5a6f317a5cc39fda0a67bbd93c9
MD5 8e14afec5ab6b914475b9a0ddf60c8e6
BLAKE2b-256 aed768d2ed2993f149f0126e4f55ac7a2bfbddc36ff7d7eb7a2f72cb367fd9d9

See more details on using hashes here.

Supported by

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