Skip to main content

BA Kit

bakit dependency installation for local development and testing

uv sync --all-extras --dev

Optional Tortoise ORM runtime

Bakit initializes Tortoise ORM when a service defines a TORTOISE_ORM setting. Services that do not use Tortoise can omit that setting; Bakit's Sanic app, ARQ worker, CLI commands, and interactive shell will then run without initializing Tortoise. Existing services with a TORTOISE_ORM setting keep the default behavior.

Optional Clerk authentication

Install the Sanic and Clerk extras:

pip install "balabs-kit[sanic,clerk]"

Set CLERK_ISSUER (e.g. https://your-app.clerk.accounts.dev, or your production Clerk domain). Optionally set CLERK_AUDIENCE to enforce aud, CLERK_AUTHORIZED_PARTIES to a comma-separated list of trusted browser origins for azp, and CLERK_JWKS_URL to override only the key endpoint.

If a browser sends the token in the Authorization header from another origin, name the header in the CORS_ALLOW_HEADERS setting, for example ["authorization", "content-type"]. The default ["*"] does not cover Authorization in a CORS preflight.

Then mark any view with @clerk_auth to require a valid Clerk session token (Authorization: Bearer <token> or the __session cookie):

from bakit.sanic.decorators import clerk_auth
from bakit.sanic.views import APIView, Response, route


@route(bp, "/me/")
@clerk_auth
class MeView(APIView):
    async def get(self, request):
        return Response({"user_id": request.ctx.auth_claims["sub"]})

Unmarked views are unaffected. Marked views return 401 without a valid token. On success the token claims are on request.ctx.auth_claims.

Metadata

Release files for balabs-kit 0.18.4

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

Source distribution (sdist)

Source distribution for balabs-kit 0.18.4
File Size Uploaded Provenance Actions
balabs_kit-0.18.4.tar.gz 27.4 kB With provenance Details for balabs_kit-0.18.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for balabs-kit 0.18.4
File Interpreter ABI Platform Actions
balabs_kit-0.18.4-py3-none-any.whl Python 3 none any Details for balabs_kit-0.18.4-py3-none-any.whl

Total release size: 60.7 kB

Release files / balabs_kit-0.18.4.tar.gz

Download URL balabs_kit-0.18.4.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f74f4aed39a48285918d881e043cdd66966285e138dbc5b5446d77f8e069ccb4
BLAKE2b-256 checksum
How to use checksums
dc6e27b8bd4f65da05473da6bb49f055174cf3fe1bc69cd65d77597f2b489339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / balabs_kit-0.18.4-py3-none-any.whl

Download URL balabs_kit-0.18.4-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38b66d4d447a2cb6abfdf83212ddf227f7f2d77e6241f380abe7e9c9ae32f2f7
BLAKE2b-256 checksum
How to use checksums
5c8dded55603bd9a31bc745aea1656a36c2b821ab0ccaa598c1fb9b77879b0f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for balabs-kit 0.18.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for balabs_kit-0.18.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

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.18.4 This release

2 release files Full 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