Skip to main content

A collection of framework specific utilities for working with Supabase.

Project description

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

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

sb_utils-0.1.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

sb_utils-0.1.1-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file sb_utils-0.1.1.tar.gz.

File metadata

  • Download URL: sb_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for sb_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9874990bec7cab95684bfd2fd9954cbbfc0d164b0cb9e72b2f5c64c9a5f93dc5
MD5 284eb1d808ae86f0365a904b9d9a0ac1
BLAKE2b-256 71b26af43048cfdba0b3bf762c8643b2849487926a2fb1b294eb0d48edd5d31d

See more details on using hashes here.

File details

Details for the file sb_utils-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sb_utils-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for sb_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cbed5a5774d05ea40933f63afa1302633c5a1d416ba13bdf6edf2ebbb1f5e115
MD5 c348e45fd587790d4efe7ab5e4325ddd
BLAKE2b-256 328cceda52ccca069cc411b96ecb834a13c036484bd2594b7360a6f93d18d3e0

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