Skip to main content

Python SDK for InstantDB, the Modern Firebase

Project description

Shows the Instant logo

instantdb

stars

Get Started · Examples · Docs · Discord

The Python SDK for Instant. This is a server SDK (analogous to @instantdb/admin) for running scripts, agents, data pipelines, and backend services against Instant from Python.

Install

pip install instantdb
# or
uv add instantdb

Quick start

from instantdb import init, id

db = init(app_id="...", admin_token="...")

# Query data
result = db.query({"goals": {"todos": {}}})
print(result["goals"])

# Write data
goal_id = id()
db.transact([
    db.tx.goals[goal_id].update({"title": "Get fit"}),
    db.tx.todos[id()].update({"title": "Go on a run"}),
])

# Subscribe to live changes
for payload in db.subscribe_query({"goals": {}}):
    if payload["type"] == "error":
        print("error:", payload["error"])
        break
    print("data:", payload["data"])

See the backend docs for the full admin API reference. The Python SDK mirrors that surface 1:1, with naming Pythonized to snake_case.

Development

Clone the repo. From client/packages/python/:

make install   # pip install -e ".[dev]"
make check     # ruff + mypy + pytest (~40 unit tests)

Pure-logic only - covers tx builder, validators, header construction. For end-to-end testing against a real backend, use the sandbox at client/sandbox/admin-sdk-python/.

Questions?

If you have any questions, feel free to drop us a line on our Discord.

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

instantdb-0.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

instantdb-0.0.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file instantdb-0.0.1.tar.gz.

File metadata

  • Download URL: instantdb-0.0.1.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for instantdb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 667ae67adc9e90eb44fb106efbd76cac57a53eee757d4142bf24c02065c1d9eb
MD5 65920c79456ee7e853ee8abc51319760
BLAKE2b-256 5348a80d5b6fdd049f71b32e527cd6844bc791d9ece0d8723fe4875eb371a43d

See more details on using hashes here.

File details

Details for the file instantdb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: instantdb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for instantdb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9315b21d68f9e5ea1033f12c94cdc47408cf5d18ed9f6cf9aab840ad01ad182b
MD5 3462994e28f6d98bd7cad2e6150999df
BLAKE2b-256 6bfea0b8ad7293ea28b4c32c28ea60b997a088c3e912190b81d31bb6a45042b1

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