TypeBridge is a typed application toolkit for TypeDB. It defines and evolves schemas, generates application models, and provides native Python, TypeScript/Node, and Rust data APIs. One Rust semantic engine owns schema, query, migration, validation, and ORM behavior across every SDK and the standalone query server.
One system, several ways in
| Surface | Use it for | Distribution |
|---|---|---|
| Python | Declarative Pydantic models, CRUD, queries, schema management | type-bridge |
| TypeScript / Node | Branded models, typed managers, queries, native runtime | @type-bridge/node |
| Rust | Generated schema crates, async CRUD and immutable queries | Exact release source/Git revision |
| CLI and generators | Split-YAML schemas, migrations, Python/Node/Rust projections | Included with the Python package |
| Server | Remote V2 query execution over the same contracts | ghcr.io/ds1sqe/type-bridge-server |
TypeBridge is designed around TypeDB rather than flattened into a relational ORM shape:
- attributes remain independent types owned by entities and relations;
- roles, inheritance, cardinality, ordering,
@key, and@uniquestay typed; - schema generation and migration use the same rules as runtime queries;
- direct and remote immutable queries preserve typed, owner-aware results;
- Python and Node are thin facades over the shared Rust runtime.
Start with Python
Requires Python 3.12–3.14 and a supported TypeDB 3.x server.
pip install type-bridge
from type_bridge import Database, Entity, Flag, Integer, Key, SchemaManager, String
class PersonId(String):
pass
class Age(Integer):
pass
class Person(Entity):
person_id: PersonId = Flag(Key)
age: Age | None = None
db = Database(address="localhost:1729", database="example")
db.connect()
db.create_database()
schema = SchemaManager(db)
schema.register(Person)
schema.sync_schema()
ada = Person(person_id=PersonId("ada"), age=Age(36))
Person.manager(db).put(ada)
people = Person.manager(db).filter(age__gte=18).all()
Continue with the Python quick start, then choose the model, data, or schema workflow.
TypeScript / Node
npm install @type-bridge/node
import { Entity, Key, attr, field } from "@type-bridge/node";
class PersonId extends attr.String("person-id") {}
class Person extends Entity("person", {
personId: field(PersonId, Key),
}) {}
const ada = new Person({ personId: new PersonId("ada") });
See the TypeScript/Node guide for native targets, database lifecycle, managers, queries, and generation.
Schema-first and Rust workflows
The V2 workspace makes a versioned Split-YAML schema the authority and projects it into each configured SDK:
type-bridge --manifest typebridge.yaml schema check
type-bridge --manifest typebridge.yaml schema generate
type-bridge --manifest typebridge.yaml migration make --name initial
type-bridge --manifest typebridge.yaml migration apply --environment development
The generated Rust SDK requires Rust 1.88+ and the exact Git revision recorded by the matching release; it is not distributed from crates.io in 2.0. Follow the Rust client guide and Split-YAML reference for the reproducible setup.
Documentation
- Install a surface
- Choose an SDK
- Model TypeDB data
- Read and write data
- Manage schemas and migrations
- Run the server
- Upgrade to 2.0
- Python API reference
TypeBridge 2.0.x supports TypeDB 3.8–3.12. Support for 3.8 and 3.10 is deprecated and scheduled for removal in 2.1; consult the compatibility matrix and deprecation inventory before upgrading production deployments.
Development
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 uv sync --extra dev
uv run pytest
./test.sh
./scripts/check.sh all
uv run --extra docs mkdocs build --strict
See DEVELOPMENT.md for repository layout, test tiers, docs architecture, and contribution checks.
License
TypeBridge-authored code is MIT licensed. Native artifacts also include
third-party TypeDB components under Apache-2.0 and MPL-2.0; exact notices ship
with each artifact and are documented in
type-bridge-core/vendor/README.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file type_bridge-2.0.0.tar.gz.
File metadata
- Download URL: type_bridge-2.0.0.tar.gz
- Upload date:
- Size: 255.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b72f8c46d5cddfed3bc33667ab1b06d997538d0606ca8a7de0152a3814d878de
|
|
| MD5 |
63770a71e152c5452dca0bf857ac3693
|
|
| BLAKE2b-256 |
a3f36888fb754913012132248268aecb7012dfe35ade97b322b6c22b163f8efe
|
Provenance
The following attestation bundles were made for type_bridge-2.0.0.tar.gz:
Publisher:
release.yml on ds1sqe/type-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_bridge-2.0.0.tar.gz -
Subject digest:
b72f8c46d5cddfed3bc33667ab1b06d997538d0606ca8a7de0152a3814d878de - Sigstore transparency entry: 2331296659
- Sigstore integration time:
-
Permalink:
ds1sqe/type-bridge@2210634bfd79b5eb668dce96db50528236125023 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ds1sqe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2210634bfd79b5eb668dce96db50528236125023 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file type_bridge-2.0.0-py3-none-any.whl.
File metadata
- Download URL: type_bridge-2.0.0-py3-none-any.whl
- Upload date:
- Size: 320.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
910ab0ac8e8d3268c345955b19517e4d39730cb8b07ac1dfcb9b9a8d236210f5
|
|
| MD5 |
04bff8945031600dc33bdc8b3a5010d9
|
|
| BLAKE2b-256 |
17978b8f2acf74dd8cb40d8ff494456d4c1f89a0e36c2b9c4da6db5779214123
|
Provenance
The following attestation bundles were made for type_bridge-2.0.0-py3-none-any.whl:
Publisher:
release.yml on ds1sqe/type-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
type_bridge-2.0.0-py3-none-any.whl -
Subject digest:
910ab0ac8e8d3268c345955b19517e4d39730cb8b07ac1dfcb9b9a8d236210f5 - Sigstore transparency entry: 2331297000
- Sigstore integration time:
-
Permalink:
ds1sqe/type-bridge@2210634bfd79b5eb668dce96db50528236125023 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ds1sqe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2210634bfd79b5eb668dce96db50528236125023 -
Trigger Event:
workflow_dispatch
-
Statement type: