supabase-py with async synax
Project description
supabase-py-async
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_async_client, AsyncClient
async def initialize():
url: str = os.environ.get("SUPABASE_URL")
key: str = os.environ.get("SUPABASE_KEY")
supabase: AsyncClient = await create_async_client(url, key)
asyncio.run(initialize())
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file supabase_py_async-0.0.1.tar.gz
.
File metadata
- Download URL: supabase_py_async-0.0.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ee33bb808d06fa25e34e0aab0026636aa7c65d81edb918be679e18dedc0e9d |
|
MD5 | 3d4546cd35c06e763a892dd90a47907a |
|
BLAKE2b-256 | b8f9d403f80ab9d2b76399f2cc144d2d5af91004d8242d6188ae531267d1321a |
File details
Details for the file supabase_py_async-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: supabase_py_async-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b4b52f7c7b5fbaf6d40d83fe24d6333a055068319d2260e8d24fb6494e8c318 |
|
MD5 | 9ff68f6145252634eb83e4ac6478388b |
|
BLAKE2b-256 | a9539f8e0555c607c328b6d7cdf2d4d24a318901295d5dbacd4cf87b1b00b60d |