Skip to main content

Python client for Dataceen GraphQL + gRPC subscription APIs

Reason this release was yanked:

Superseded by 0.0.2; 0.0.1 published under incorrect license.

Project description

dataceen-client (Python)

Python client for the Dataceen GraphQL + gRPC subscription APIs. Parallel to the C# (DataceenClient/) and TypeScript (DataceenClientTs/) reference clients — feature-parity verified against the same Thomas/CandyShopModel/All fixtures.

Status: 0.0.1 alpha. 88 unit tests green. Not yet on PyPI.

Install

python -m venv .venv
.venv\Scripts\activate            # PowerShell
pip install -e ".[dev]"

Requires Python 3.11+ (typing.NotRequired, generic TypedDict).

Configure

Copy .env.example to .env at the repo root and fill in real Azure AD credentials. The example matches the C# appsettings.json's AllClient section.

Quick start

import asyncio
from dataceen_client import DataceenClient, load_config_from_env
from dataceen_client.runtime import do_find

async def main():
    cfg = load_config_from_env()
    async with DataceenClient(cfg) as client:
        result = await do_find(
            client,
            "Customer",
            size=5,
            filter={"CustomerId": {"like": "cst"}},
            fields={
                "_id": True,
                "CustomerId": True,
                "CustomerPlacedOrder": {"Order": {"OrderId": True}},
            },
            order_by=[{"CustomerId": "Ascending"}],
        )
        for item in result["Items"]:
            print(item)

asyncio.run(main())

After running codegen, replace do_find(client, "Customer", ...) with the typed AllClient(client).Customer.find(...).

Subscriptions

async with DataceenClient(cfg) as client:
    sub = client.create_subscription(
        topics=["Customer"],
        baseload_topics=["Customer"],
        start_mode="POSITION_BEGINNING",
        include_complete=True,
    )

    async def on_customer(evt):
        if evt.event_type == "BASELOAD_EVENT":
            ...  # evt.complete is parsed JSON
        elif evt.event_type == "SUBSCRIPTION_EVENT":
            ...  # live event

    sub.on("Customer", on_customer)
    await client.subscribe(sub)   # blocks until sub.cancel()

Codegen

python -m tools.codegen.src.cli fetch          # cache schema.json
python -m tools.codegen.src.cli emit Customer  # Customer + everything it references
python -m tools.codegen.src.cli emit-all       # whole model

Output → src/dataceen_client/generated/ (gitignored). Per entity you get typed TypedDicts for read/create/filter/fields, a change-tracked Update class, and an <Entity>Client wrapping the runtime helpers; AllClient aggregates the top-level entities.

Codegen runs from a source checkout — it is intentionally not part of the published wheel (only the runtime dataceen_client package is shipped).

Tests

pytest                       # 88 unit tests, ~1.7s
RUN_INTEGRATION=1 pytest     # also run live-backend integration tests (needs .env)

Example app

End-to-end example against the live backend:

python -m examples.candy_shop.find
python -m examples.candy_shop.search_and_aggregate
python -m examples.candy_shop.subscriber
python -m examples.candy_shop.program                    # full read-only orchestrator
RUN_DESTRUCTIVE=1 python -m examples.candy_shop.program  # also create/update/delete

Docs

  • docs/plan.md — phase plan
  • docs/decisions.md — decisions and motivation
  • docs/progress.md — live status
  • docs/dsl-comparison.md — why pure-dict DSL for Python
  • docs/porting-guide.md — Python-specific amendments to the canonical guide
  • docs/release.md — version-bump and publish runbook

License

Proprietary — see LICENSE.

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

dataceen_client-0.0.1.tar.gz (70.8 kB view details)

Uploaded Source

Built Distribution

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

dataceen_client-0.0.1-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file dataceen_client-0.0.1.tar.gz.

File metadata

  • Download URL: dataceen_client-0.0.1.tar.gz
  • Upload date:
  • Size: 70.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for dataceen_client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ca36a425ca67e7c1c62e23ec20699ce3d446c081c597ea95c32c17073f6b62e8
MD5 c095f9a87ae72596777c3d37ae506cfc
BLAKE2b-256 d5c718a849960b1674c39f8a0fddac1d9c4f0df6c7785998bd2e2ed6063b437a

See more details on using hashes here.

File details

Details for the file dataceen_client-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dataceen_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7e0c75545581ab7a9e4cfb0df12687c07641290c59edd0ffbf2f31b5aea2afc
MD5 f16b8b7d1787867cd6a93040902f4b26
BLAKE2b-256 aaabdb11f44766e0d6059b1946307e523bf4f6f91758d60bf60c2268396bd416

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