Metadata-Version: 2.4
Name: instantdb
Version: 0.0.1
Summary: Python SDK for InstantDB, the Modern Firebase
Project-URL: Homepage, https://instantdb.com
Project-URL: Documentation, https://instantdb.com/docs
Project-URL: Repository, https://github.com/instantdb/instant
Project-URL: Issues, https://github.com/instantdb/instant/issues
Author-email: Instant <founders@instantdb.com>
License-Expression: Apache-2.0
Keywords: database,graph,instant,instantdb,realtime
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx-sse>=0.4
Requires-Dist: httpx>=0.27
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

<p align="center">
  <a href="https://instantdb.com">
    <img alt="Shows the Instant logo" src="https://instantdb.com/img/icon/android-chrome-512x512.png" width="10%">
  </a>
  <h1 align="center">instantdb</h1>
</p>

<p align="center">
  <a href="https://discord.com/invite/VU53p7uQcE">
    <img height=20 src="https://img.shields.io/discord/1031957483243188235" />
  </a>
  <img src="https://img.shields.io/github/stars/instantdb/instant" alt="stars">
</p>

<p align="center">
   <a href="https://www.instantdb.com/docs/backend">Get Started</a> ·
   <a href="https://instantdb.com/examples">Examples</a> ·
   <a href="https://www.instantdb.com/docs/backend">Docs</a> ·
   <a href="https://discord.com/invite/VU53p7uQcE">Discord</a>
</p>

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

## Install

```bash
pip install instantdb
# or
uv add instantdb
```

## Quick start

```python
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](https://www.instantdb.com/docs/backend) for the full
admin API reference. The Python SDK mirrors that surface 1:1, with naming
Pythonized to `snake_case`.

## Development

Clone the [repo](https://github.com/instantdb/instant). From `client/packages/python/`:

```bash
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/`](../../sandbox/admin-sdk-python/).

## Questions?

If you have any questions, feel free to drop us a line on our
[Discord](https://discord.com/invite/VU53p7uQcE).
