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.

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 and are automatically excluded from the cache middleware (an authenticated response must never be shared between users). On success the token claims are on request.ctx.auth_claims.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

balabs_kit-0.9.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

balabs_kit-0.9.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file balabs_kit-0.9.0.tar.gz.

File metadata

  • Download URL: balabs_kit-0.9.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for balabs_kit-0.9.0.tar.gz
Algorithm Hash digest
SHA256 924653ef4664e048c60ff95eb3fc44e291f99ef0884ce3d61cfc8151b6d6ad9c
MD5 aebf6a7df7b420436909375884bf2873
BLAKE2b-256 992292e28e5d9ad02c5a1325625b22da291600bf1b69c346d1464518557aa3ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for balabs_kit-0.9.0.tar.gz:

Publisher: publish.yml on blockanalitica/bakit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file balabs_kit-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: balabs_kit-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for balabs_kit-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c70fd74c3d1ebb2018633d3d09f0eb3c81d279fe654be0901c8c24f9d13729e
MD5 bc812fc341fe44d6e7f2580201c9b1b9
BLAKE2b-256 771afe980dcd315cf9dfa854c69759396e9fd197a874839e14710d7ee2f09986

See more details on using hashes here.

Provenance

The following attestation bundles were made for balabs_kit-0.9.0-py3-none-any.whl:

Publisher: publish.yml on blockanalitica/bakit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.9.1

2 files

This release

0.9.0 This release

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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