This release is a pre-release and may not be stable for production use.
fletbase-sdk
The Python client for FletBase, the backend for Flet apps: a Firestore-style document database that runs on Cloudflare, with auth and file storage to follow.
Pre-alpha. The API and the wire protocol still change between releases. Pin an exact version.
- Async only. One API, written with
await, everywhere. - Runs where Flet runs: desktop, mobile, and the browser. Under Pyodide (
flet build web, Flet Studio's preview) it talks through the browser's ownfetch, and does not even installhttpx. - Small. One runtime dependency,
httpx, and only outside the browser.
Install
pip install fletbase-sdk
Or add fletbase-sdk to your app's [project].dependencies. The package you
import is fletbase.
Quickstart
import asyncio
import fletbase
from fletbase import database
async def main():
async with fletbase.server(
base_url="https://api.flet.app",
project_id="prj_...",
service_key="fb_ak_...",
) as project:
todos = project.database.collection("todos")
ref = await todos.add({"title": "Ship v1", "views": 0})
await ref.update({"views": database.increment(1)}) # computed by the server
snap = await ref.get()
print(snap["title"], snap["views"], snap.revision)
asyncio.run(main())
fletbase.server() is the handle for trusted code (scripts, backends, CI), and
takes a service or operator key. Never put such a key in an app you ship to users.
What works today
| Documents | add, get, set (with merge=), update, delete, guarded by revision= |
| Field transforms | database.increment, array_union, array_remove, server_timestamp, delete_field |
| Atomic writes | db.batch(), and optimistic transactions with db.run_transaction(...) |
| Retries | every write carries a mutation ID, so a retried write is applied once |
Coming:
- queries (
where,order_by, cursors, aggregates); - saving and loading dataclasses (
model=); fletbase.project()for public apps, with end-user sign-in;- realtime listeners;
- files;
- local databases (
database.local(...)) that live on the device, browser included, behind the same API.
Debugging
Set FLETBASE_DEBUG=1 to print every request and response, or pass debug=True to
fletbase.server(). Credentials are never printed. fletbase.observability has the
programmatic hooks.
License
Apache-2.0. The FletBase server is licensed separately; see the repository.
Metadata
Release files for fletbase-sdk 0.1.0a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fletbase_sdk-0.1.0a0.tar.gz | 47.9 kB | Without provenance | Details for fletbase_sdk-0.1.0a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fletbase_sdk-0.1.0a0-py3-none-any.whl | Python 3 | none | any | Details for fletbase_sdk-0.1.0a0-py3-none-any.whl |
Total release size: 111.2 kB
Release files / fletbase_sdk-0.1.0a0.tar.gz
| Download URL | fletbase_sdk-0.1.0a0.tar.gz |
|---|---|
| Size | 47.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5dc26924c838440810e6085553f095c9e445be0434223935d36f68647b20308
|
|
BLAKE2b-256 checksum How to use checksums |
89b33f0c49c556c61481c3af4c0d32f7f09ddce84eb2eabb14004d05862ad81e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fletbase_sdk-0.1.0a0-py3-none-any.whl
| Download URL | fletbase_sdk-0.1.0a0-py3-none-any.whl |
|---|---|
| Size | 63.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4fb3c1d5c3e424d9f67aa920f473b1fcffad9e37a7e92e826677e71d89c8adf
|
|
BLAKE2b-256 checksum How to use checksums |
4a61620579efb9d690274d1b92b90e8d75ca72032c1fb8cac094c34fbb27e0d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for fletbase-sdk 0.1.0a0
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.