Skip to main content

TyDB

A simple, type-friendly Python ORM.

Features

Things one might expect of any ORM:

  • Lightweight class-based models and descriptor-based fields
  • Built-in fields for common types
  • Primary keys
  • Foreign keys with attribute accessors and joined queries
  • Separate nullable fields

Things one might not:

  • Reliable type signatures on the public API
  • Support for any DB-API 2.0 database driver
  • Synchronous and asynchronous operation under a common API

Database support

Low-level interaction with databases is handled by a DB-API Connection. This means you can work with any type of database, as long as a database driver exists that implements a DB-API interface -- Python's built-in SQLite library does so, whilst external modules are available for MySQL, PostgreSQL and others.

Whilst there's no asynchronous DB-API specification, some database drivers implement a DB-API-like interface with the same methods presented as coroutines; these are supported with asynchronous sessions, which will attempt to await results of Connection method calls if they return awaitables.

Local development

To install the library from a code checkout, including development dependencies:

$ pip install -e '.[dev]'

Docs

These can be built using pdoc, assuming you've installed the dev requirements already:

$ make docs

Unit tests

The included tests can be ran using:

$ make test

By default, this will just run generic tests, and SQLite tests against an in-memory database.

To run against MySQL or PostgreSQL, you'll need the corresponding database drivers installed from the dev dependencies. Credentials must also be provided to connect to live database servers. These should be JSON-formatted strings containing kwargs for the underlying driver connection methods. For example, to connect to servers listening locally without authentication:

$ export TYDB_MYSQL_CONN='{"db": "tydb"}'
$ export TYDB_PGSQL_CONN='{"dbname": "tydb"}'

Only synchronous session and driver tests are run by default. To enable asynchronous tests too:

$ export TYDB_ASYNC=1

The dialect-aware tests currently use the following databases and drivers:

Metadata

Release files for TyDB 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for TyDB 0.1.1
File Size Uploaded Provenance
tydb-0.1.1.tar.gz 21.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for TyDB 0.1.1
File Interpreter ABI Platform
tydb-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 41.1 kB

Release files / tydb-0.1.1.tar.gz

Download URL tydb-0.1.1.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
92efd2a6c4b9996a09effdbba0c27e9b47b6de575eecc7108e5b7eae764289cb
BLAKE2b-256 checksum
How to use checksums
c9f685a86a7a661478dfa0c66ce16b798409ff6d71d10c4d3f416e4a02e0932c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / tydb-0.1.1-py3-none-any.whl

Download URL tydb-0.1.1-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca98086ab03d835bb122435da87d7bb6462fd43f0a36ac380b52d336752fa95b
BLAKE2b-256 checksum
How to use checksums
54d3870a00d67ce76b39dc7d813e616c4415f1f9b68d0233eb9e140d414a7806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for TyDB 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page