Skip to main content

Business logic - Supabase (bisslog-supabase-py)

PyPI License: MIT

It is an extension of the bisslog library to support processes with the Supabase service using the official Python SDK.

If you want to know more about what bisslog is, you can enter here or in their library


🚀 Installation

You can install bisslog-supabase-py using pip:

pip install bisslog-supabase-py

Usage example

import os
from supabase import create_client
from abc import ABC, abstractmethod
from bisslog import Division, bisslog_db
from bisslog_supabase import BasicSupabaseHelper, bisslog_exc_mapper_supabase


class MarketingDivision(Division, ABC):

    @abstractmethod
    def find_sales_per_client(self, email: str):
        raise NotImplementedError("find_sales_per_client must be implemented")


class MarketingSupabaseDivision(MarketingDivision, BasicSupabaseHelper):

    @bisslog_exc_mapper_supabase
    def find_sales_per_client(self, email: str):
        return self.find_one("sales", {"email": email})


supabase_url = os.environ["SUPABASE_URL"]
supabase_key = os.environ["SUPABASE_SERVICE_ROLE"]
client = create_client(supabase_url, supabase_key)

marketing_div = MarketingSupabaseDivision(client)
bisslog_db.register_adapters(marketing=marketing_div)

Components

BasicSupabaseHelper

BasicSupabaseHelper is a helper class for interacting with Supabase tables via the official SDK.
It provides convenient methods for performing insert, query, and count operations while maintaining traceability through TransactionTraceable.

Initialization

BasicSupabaseHelper(client: SupabaseClient)

Initializes the helper with a SupabaseClient instance.

Methods

  • insert_one
insert_one(table: str, data: dict) -> Optional[dict]

Inserts a record into the specified table and returns the inserted data or None.

  • find_one
find_one(table: str, filters: dict) -> Optional[dict]

Fetches a single row matching the filters or returns None.

  • get_length
get_length(table: str, filters: Optional[dict] = None) -> int

Returns the number of matching rows in the given table.

bisslog_exc_mapper_supabase

Decorator to map Supabase or HTTPX exceptions to their corresponding Bisslog exceptions.

Exception (httpx/Supabase) Mapped Bisslog Exception
HTTPStatusError 400 InvalidDataExtException
HTTPStatusError 401 ConfigurationExtException
HTTPStatusError 403/404 ProgrammingErrorExtException
HTTPStatusError 409 IntegrityErrorExtException
HTTPStatusError 5xx OperationalErrorExtException
TimeoutException TimeoutExtException
RequestError ConnectionExtException
Exception (fallback) ExternalInteractionError

📜 License

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

Metadata

Release files for bisslog-supabase 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bisslog-supabase 0.0.0
File Size Uploaded Provenance
bisslog_supabase-0.0.0.tar.gz 9.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bisslog-supabase 0.0.0
File Interpreter ABI Platform
bisslog_supabase-0.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / bisslog_supabase-0.0.0.tar.gz

Download URL bisslog_supabase-0.0.0.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac20b6ed4fecf0a0fe276f954c930392127fb2e9072821b79d408dced7d22acd
BLAKE2b-256 checksum
How to use checksums
9d12a12482def2b1cf73912fabe001e483b8fad67a51f037d18effb53e1c842b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / bisslog_supabase-0.0.0-py3-none-any.whl

Download URL bisslog_supabase-0.0.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fcfa8a6ac93ed45accac2d68f100eda276294f015a774a6607bdff7d00a5288
BLAKE2b-256 checksum
How to use checksums
f4b19f683ff41eba58e08100303e254edef57ca8a55b7629ee672eb32f96aa99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for bisslog-supabase 0.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page