Skip to main content

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

CI PyPI npm crates.io 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 type-bridge
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, starting with 2.0.1, resolves from crates.io with type-bridge = "2". TypeBridge 2.0.0 remains available from its exact Git revision. 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.1.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.1-py3-none-any.whl (320.5 kB view details)

Uploaded Python 3

File details

Details for the file type_bridge-2.0.1.tar.gz.

File metadata

  • Download URL: type_bridge-2.0.1.tar.gz
  • Upload date:
  • Size: 255.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for type_bridge-2.0.1.tar.gz
Algorithm Hash digest
SHA256 6873286a870d3765fdcdeb97c7ecbfd62148a84caa84270d628f24ee66924e9a
MD5 401771b8f1adf1e628bb371b68c9d44f
BLAKE2b-256 fb6de6cb2c01f0dace27bc01abbb2fce102f0e9faddc43cfe9305702adc97863

See more details on using hashes here.

File details

Details for the file type_bridge-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: type_bridge-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 320.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for type_bridge-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcd3f060e6209268df8ff17e5ef72a2be430c7e1e1578c1b228577d565bfc0f8
MD5 979d47618f2cc03c5711fee63b298c95
BLAKE2b-256 7c878942f9b7876f93aa43114a0d3afa81ea66583d9a34cd9d87024ee7e1166d

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 Sentry Error logging StatusPage Status page