Skip to main content

TypeBridge connects typed Python, TypeScript, and Rust applications to TypeDB through one semantic engine.

CI PyPI npm Documentation MIT license

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 @unique stay 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

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

type_bridge-2.0.0.tar.gz (255.1 kB view details)

Uploaded Source

Built Distribution

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

type_bridge-2.0.0-py3-none-any.whl (320.5 kB view details)

Uploaded Python 3

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

Hashes for type_bridge-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b72f8c46d5cddfed3bc33667ab1b06d997538d0606ca8a7de0152a3814d878de
MD5 63770a71e152c5452dca0bf857ac3693
BLAKE2b-256 a3f36888fb754913012132248268aecb7012dfe35ade97b322b6c22b163f8efe

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_bridge-2.0.0.tar.gz:

Publisher: release.yml on ds1sqe/type-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for type_bridge-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 910ab0ac8e8d3268c345955b19517e4d39730cb8b07ac1dfcb9b9a8d236210f5
MD5 04bff8945031600dc33bdc8b3a5010d9
BLAKE2b-256 17978b8f2acf74dd8cb40d8ff494456d4c1f89a0e36c2b9c4da6db5779214123

See more details on using hashes here.

Provenance

The following attestation bundles were made for type_bridge-2.0.0-py3-none-any.whl:

Publisher: release.yml on ds1sqe/type-bridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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