Skip to content

EN SDK YoungLion and DDM

Cavanshirpro edited this page Sep 19, 2026 · 1 revision

Optional YoungLion and DDM adapters

English · Türkçe · Languages / Diller

Scope: JSON API Forge 0.5.1 · Source review: 17 September 2026 · Language: English

The base SDK does not require YoungLion. The younglion and ddm extras optionally install the compatible YoungLion>=0.1.0,<0.2 dependency. Imports are lazy; ordinary ForgeClient usage does not depend on these integrations.

python -m pip install "json-api-forge-client[younglion] @ git+https://github.com/YoungLionOrganization/JSON-API-Forge.git@9507fa902838f66400a603cea22b271a79d4eb9c"

[ddm] is another extra name for the same dependency intent. Registry access and a compatible dependency must be available; adapter source does not establish installability in every environment.

YoungLion client

import os
from YoungLion import DDM
from json_api_forge.integrations import YoungLionForgeClient

with YoungLionForgeClient.connect(
    "https://api.example.com", api_key=os.environ["FORGE_API_KEY"]
) as forge:
    response = forge.create_item("wiki-demo", "items", DDM({"name": "YoungLion"}))
    print(response.data.to_dict())

YoungLionForgeClient wraps the synchronous client. Its extra helpers cover create/update/list, operation and request flows with DDM. Do not assume every base-client method is exposed under the same name by the wrapper.

Wrap an existing client

from json_api_forge import ForgeClient
from json_api_forge.integrations import DDMForgeClient, ddm_available

if not ddm_available():
    raise RuntimeError("Install the DDM extra")

with DDMForgeClient(ForgeClient("https://api.example.com")) as forge:
    result = forge.request("GET", "health")
    print(result.data.to_dict())

AsyncDDMForgeClient wraps AsyncForgeClient and uses async contexts/await. Closing a wrapper also closes its wrapped client; consider ownership if another component still needs that client.

Conversion contract

Payloads convert mappings, lists, tuples and to_dict() values into plain JSON-compatible structures. Mapping responses become DDM objects; non-mapping responses such as scalars/lists are wrapped as {"value": ...}. HTTP status, request ID, replay and cache metadata are preserved.

Missing/incompatible integrations raise ForgeIntegrationError. DDM conversion does not add authorization, validation or idempotency guarantees; those remain part of the standard client/server contract. Applications not using the adapter need not install the extra.

Sources and verification

This page describes the behavior at the pinned commits below. Recheck these contracts when upgrading.


English home · All English pages · Version maintenance

Clone this wiki locally