Skip to main content

Official Python SDK for interacting with the BosBase API.

Project description

BosBase Python SDK

BosBase provides a batteries-included backend with collections, authentication, files, vector search, LangChaingo flows, realtime subscriptions, and more.
This package is the official Python SDK that mirrors the JavaScript and Dart SDKs in this repository so Python developers can talk to the BosBase API with a familiar API surface.

Installation

pip install bosbase

Quick start

from bosbase import BosBase

pb = BosBase("http://127.0.0.1:8090")

# Authenticate as auth collection record
auth = pb.collection("users").auth_with_password("test@example.com", "123456")
print(auth.token)

# List records
posts = pb.collection("posts").get_list(page=1, per_page=10, query={"expand": "author"})
for post in posts["items"]:
    print(post["title"])

# Create a record with a file
with open("cover.png", "rb") as handle:
    pb.collection("posts").create(
        body={"title": "Hello", "status": "published"},
        files={"cover": ("cover.png", handle, "image/png")},
    )

# Realtime subscription
unsubscribe = pb.collection("posts").subscribe("*", lambda event: print(event["action"]))
# ...
unsubscribe()

High-level features

  • pb.collection("...") – CRUD helpers, auth flows, OTP/MFA helpers, impersonation.
  • pb.collections – Manage collections, scaffolds, schema queries.
  • pb.files – Token generation and URL building for protected files.
  • pb.logs, pb.crons, pb.backups, pb.vectors, pb.llm_documents, pb.langchaingo, pb.caches – Service wrappers that mirror the JavaScript SDK.
  • pb.realtime – SSE based realtime subscriptions with automatic reconnection.
  • pb.create_batch() – Transactional batch writes across collections.

The SDK exposes the same filter builder (pb.filter()), before_send / after_send hooks, and auth store semantics as the other SDKs, so existing examples port to Python with minimal changes.

Documentation

The docs/ directory mirrors the JavaScript SDK guides, adapted for Python. Highlights:

  • COLLECTIONS.md: collection types, scaffolds, schema queries.
  • API_RECORDS.md: CRUD, batch operations, auth helpers.
  • REALTIME.md: realtime subscriptions, connection lifecycle.
  • FILES.md, FILE_API.md: uploads, tokens, download URLs.
  • LANGCHAINGO_API.md, LLM_DOCUMENTS.md, VECTOR_API.md: AI and RAG workflows.

Every topic from the JS SDK now has a Python-specific counterpart with code samples.

See SDK_DOCUMENTATION.md in the repo for feature-specific guides.

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

bosbase-0.1.1.tar.gz (54.1 kB view details)

Uploaded Source

Built Distribution

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

bosbase-0.1.1-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bosbase-0.1.1.tar.gz
  • Upload date:
  • Size: 54.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for bosbase-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c9956d5dcfa7ba38fe934e9639925e4f4cc7a7532a7dad81a3ccd169c36278de
MD5 30cdcf4efe0803b0d6a7f0626e973c7c
BLAKE2b-256 ce92bbe529f443727381eadf2b98eb9389b8a3a26ae2e29b46576172d9e2f905

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bosbase-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for bosbase-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a795cafffe3b0ea576b642516299af60fbb19a1f4e5c1c54cac0cdd553c23eb1
MD5 4069ba93201f837b3d352f6448b23482
BLAKE2b-256 25c227c4dc6045b3aa6c24401904aa895030ed45b9c211d0bc6d78c615a46665

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page