Skip to main content

Reusable TypeDB 3 Python utilities and interface layer

Project description

typedb_utils

typedb_utils is the reusable, non-ROS TypeDB 3 Python layer extracted from the ros_typedb repository.

It provides:

  • TypeDBInterface for connecting to TypeDB, loading schema/data, and running define/insert/delete/fetch/get/aggregate queries
  • helper functions for converting Python values to TypeQL literals and building common query fragments

This package is still kept inside the same monorepo so it can be built with colcon together with ros_typedb, but it has no ROS runtime dependencies.

Example:

from typedb_utils.typedb_interface import TypeDBInterface


db = TypeDBInterface(
    'localhost:1729',
    'example_db',
    schema_path=['/abs/path/schema.tql'],
    data_path=['/abs/path/data.tql'],
    force_database=True,
)

rows = db.fetch_database(
    """
    match
        $p isa person;
    fetch { "email": $p.email };
    """
)

Packaging

typedb_utils is both an ament_python workspace package and a standard Python distribution. You can build it locally with:

cd typedb_utils
python3 -m pip install --upgrade build twine
python3 -m build
python3 -m twine check dist/*

The repository also includes GitHub Actions workflow publish-typedb-utils.yml, which builds the package from the typedb_utils/ subdirectory and publishes it to PyPI via Trusted Publishing on tags matching typedb_utils-v*.

Release flow:

  1. bump the version in typedb_utils/setup.py and typedb_utils/package.xml
  2. push the commit to main
  3. create and push a matching tag such as typedb_utils-v0.1.0
  4. ensure the PyPI project is configured with this GitHub workflow as a Trusted Publisher

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typedb_utils-0.1.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

typedb_utils-0.1.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file typedb_utils-0.1.1.tar.gz.

File metadata

  • Download URL: typedb_utils-0.1.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for typedb_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fd94c01bf61de27b7dc82ba94f8cfc8112767512cfeee0cd5ab022d9c8b232f0
MD5 38e4b648a410837490350651540cd25e
BLAKE2b-256 78420c0d164a008cfcc896c95db727a1f4565c7c10b16bcd55c4210b79cdbe91

See more details on using hashes here.

Provenance

The following attestation bundles were made for typedb_utils-0.1.1.tar.gz:

Publisher: publish-typedb-utils.yml on kas-lab/ros_typedb

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

File details

Details for the file typedb_utils-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: typedb_utils-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for typedb_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b309fb9eb0265b4e7e0feb332e5c800ec51b8f06f0617fd4eb2e06e6ba354ba
MD5 4917919f39cc3d71e0096eddce712207
BLAKE2b-256 b63c8efa16b304476b86db2f0ea9b1698505dff0b14c764e263a46791c0a156c

See more details on using hashes here.

Provenance

The following attestation bundles were made for typedb_utils-0.1.1-py3-none-any.whl:

Publisher: publish-typedb-utils.yml on kas-lab/ros_typedb

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