Skip to main content

Async-native Python client for the OrientDB binary protocol

Project description

aioorient

PyPI Python CI License: MIT

Async-native Python client for the OrientDB binary protocol. Typed, tested, pooled, and dependency-free. Targets OrientDB 3.0+ (v37/v38 wire protocol) on Python 3.13+.

Quickstart

import asyncio
from aioorient import Client

async def main() -> None:
    async with await Client.connect(
        "localhost", 2424, user="root", password="rootpw"
    ) as client:
        async with client.database("demo", user="admin", password="adminpw") as db:
            rows = await db.query("SELECT FROM Person WHERE age > :min", params={"min": 18})
            for row in rows:
                print(row["name"], row.rid)

asyncio.run(main())

Install

pip install aioorient

Zero runtime dependencies. An optional C extension accelerates record decoding and ships in the binary wheels; without it, a pure-Python decoder is used transparently.

Features

  • Async-only. Everything is await-ed; no sync wrapper, no blocking I/O.
  • Typed. mypy --strict clean, ships py.typed; dict[str, Any] only where OrientDB values are genuinely polymorphic.
  • Pooled by default. One Client → a server-level pool plus per-database query and batch pools, with health checks and back-pressure. No socket wrangling.
  • v38 transactions. async with db.transaction() as tx: with MVCC-enforced expected_version.
  • Streaming queries. async for row in db.query_stream(sql): pages under the hood without leaking server-side cursors.
  • Live queries. async with db.live_query(sql) as sub: with a bounded buffer and clean three-way teardown.
  • Binary v37 codec. Full document encode/decode with varint + zigzag primitives and an optional C fast path.
  • Object-graph mapper. Declarative vertices/edges, property descriptors, a chainable query DSL, atomic batches, and per-class brokers.

Documentation

Full guides live in docs/:

Object-graph mapper at a glance

from aioorient.ogm import Graph, declarative_node, String, Integer

Node = declarative_node()

class Person(Node):
    element_type = "Person"
    name = String()
    age = Integer()

async with Graph(db, bases=[Node]) as g:
    await g.init_schema()
    alice = await g.create_vertex(Person, name="Alice", age=30)
    adults = await g.query(Person).where(Person.age >= 18).order_by(Person.name).all()

See the OGM guide for the query DSL, batches, brokers, and traversals.

Gremlin traversals at a glance

OrientDB can execute TinkerPop 3 Gremlin traversals server-side; aioorient sends them over the same binary connection via db.script(language="gremlin"). The server binds g = graph.traversal(), so you write standard Gremlin directly (needs the orientdb:3.2-tp3 image):

rows = await db.script(
    "g.V().hasLabel('Person').has('age', gte(18)).valueMap('name', 'age')",
    language="gremlin",
    params={},
)
for row in rows:
    print(row.fields)

Gremlin support is experimental. See the Gremlin guide for prerequisites, result shapes, and caveats.

Development

uv sync
uv run ruff check . && uv run ruff format --check .
uv run mypy src/aioorient tests
uv run pytest -m "not integration"          # unit tier

Integration tests require Docker (the suite starts/stops OrientDB itself):

uv run pytest -m integration

See CONTRIBUTING.md for the commit conventions that drive automated releases.

License

MIT

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

aioorient-1.0.0.tar.gz (103.5 kB view details)

Uploaded Source

Built Distributions

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

aioorient-1.0.0-cp314-cp314-win_amd64.whl (125.1 kB view details)

Uploaded CPython 3.14Windows x86-64

aioorient-1.0.0-cp314-cp314-musllinux_1_2_x86_64.whl (151.7 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

aioorient-1.0.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (152.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

aioorient-1.0.0-cp314-cp314-macosx_11_0_arm64.whl (122.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

aioorient-1.0.0-cp313-cp313-win_amd64.whl (124.8 kB view details)

Uploaded CPython 3.13Windows x86-64

aioorient-1.0.0-cp313-cp313-musllinux_1_2_x86_64.whl (152.0 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

aioorient-1.0.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (153.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64manylinux: glibc 2.5+ x86-64

aioorient-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (122.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file aioorient-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for aioorient-1.0.0.tar.gz
Algorithm Hash digest
SHA256 323814153b38222a4d08dfc6a0063100403db6ee245accd692ac0fa1ee57d1dc
MD5 c33f8d9c2ba5e8d8704b35c0fbee25f4
BLAKE2b-256 71210649cda3ed0ae639a5aa772b7a776b64cc5967b7af69f99bb95fa4c8273d

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0.tar.gz:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: aioorient-1.0.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 125.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aioorient-1.0.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 951bc51d35e96779a50a2932423c66389c396d8a1d2b747cd6c4e97e1db98e96
MD5 17e2359be00f113d5a82fec47221fb07
BLAKE2b-256 53e772ca224a4c8e58eb00b83334e84c94cb396369e09ac214fd57ebc204129a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp314-cp314-win_amd64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for aioorient-1.0.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 46f14adc2c2d1860558114bc3007c15015d98916cb1197f05c44d8b748d19471
MD5 0a3fd412645dc0a28b2cd1c8f0a9508c
BLAKE2b-256 d9b64f44d4a2f0f36a035ffb172b1b4d160a21a25a4f5bd702ade20cc28a65c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp314-cp314-musllinux_1_2_x86_64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for aioorient-1.0.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 4e9f367bb73cca4c08c4380e3f91d8c805c5295f87ade7759ca0397c62318a95
MD5 281e696961163fc5e0f167a7ff6b9958
BLAKE2b-256 7214f0629a3eb515f38a70a1715f5a9343a4152483247cf6888241fb81463d9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aioorient-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c741218aa3ec0e631bf321fe1367e9a02f3c62a28fabf8a588fb7e9a66dbb99a
MD5 ce4fb7498190e138fe987865f574cd50
BLAKE2b-256 ed263020df7b5e591f608f881098dc537575f83fea2e194724f3ea459d210264

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: aioorient-1.0.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 124.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for aioorient-1.0.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 23f8d0a84a4c52bc1536f679c7a09a80532a6680db62d58169972f21430840e5
MD5 75303e6df774186656374acec2781029
BLAKE2b-256 1bbc943137b223e10d19f75ae364dd778993d69da1344aec6380b919b6f6109b

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for aioorient-1.0.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6065d079a64723b042e28e14dd09de15fddaff14d62b63275d7b6a2b70c8c175
MD5 ab4b679fe2f170d617002590e3f8e027
BLAKE2b-256 090f91f670b61eec0b9d5f16ea95f4c08d4287c8b43a1e706a77abfae43c2544

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for aioorient-1.0.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 4427109a76bb6be12470c55a11f8353da7c8b82eae32cd6855110781641c37c6
MD5 d6f8a1ae38cc33e39699784cf75583f7
BLAKE2b-256 401339a7e518afc0b359c5bf381ec864b6fd6ee8a9e6a4b4a75f79bcc4e844ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on obonovai/aioorient

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

File details

Details for the file aioorient-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for aioorient-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6c1293d55a6f86cd39cc8851652d94eda62ca40c739c1522b96c32b822c9e31
MD5 360de4c97f12756cf336fd6bd941da77
BLAKE2b-256 8c8ddabeda4552037b01e3bf5efd4f65017bb626fb3f295ca2464c9d07148f11

See more details on using hashes here.

Provenance

The following attestation bundles were made for aioorient-1.0.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on obonovai/aioorient

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