supabase-utils
A collection of framework specific utilities for working with Supabase.
Installation
pip supabase-utils
Usage
from sb_utils import sb_table
accounts = sb_table("accounts").select("id, title, created_by(username)", count="exact")
for account in accounts.data:
print(account.get("title"))
from pydantic import BaseModel
from sb_utils import BaseService
class User(BaseModel):
__tablename__ = "users"
id: Optional[str] = Field(default=None, primary_key=True)
username: str
class Account(BaseModel):
__tablename__ = "accounts"
id: Optional[str] = Field(default=None, primary_key=True)
title: str
created_by: User = Field(related_name="username")
class AccountService(BaseService):
model = Account
accounts = AccountService.all()
for account in accounts:
print(account.title)
Documentation
Community
License
Metadata
Release files for sb_utils 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sb_utils-0.1.1.tar.gz | 1.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sb_utils-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.1 kB
Release files / sb_utils-0.1.1.tar.gz
| Download URL | sb_utils-0.1.1.tar.gz |
|---|---|
| Size | 1.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9874990bec7cab95684bfd2fd9954cbbfc0d164b0cb9e72b2f5c64c9a5f93dc5
|
|
BLAKE2b-256 checksum How to use checksums |
71b26af43048cfdba0b3bf762c8643b2849487926a2fb1b294eb0d48edd5d31d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
|
Release files / sb_utils-0.1.1-py3-none-any.whl
| Download URL | sb_utils-0.1.1-py3-none-any.whl |
|---|---|
| Size | 2.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbed5a5774d05ea40933f63afa1302633c5a1d416ba13bdf6edf2ebbb1f5e115
|
|
BLAKE2b-256 checksum How to use checksums |
328cceda52ccca069cc411b96ecb834a13c036484bd2594b7360a6f93d18d3e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0
|