Skip to main content

Python SDK for the DX Web and DX Data Cloud APIs

Project description

getdx

PyPI version Python versions CI License: MIT

Sync-first Python SDK covering both DX APIs:

  • DX Web API (https://api.getdx.com)
  • DX Data Cloud API (https://{instance}.getdx.net/api)

This SDK does not cache API responses. Each call fetches fresh data.

Install

pip install getdx

Requires Python 3.10+.

Quickstart

Web API only

from getdx import DXClient, DXWebConfig

with DXClient(web=DXWebConfig(token="<DX_WEB_API_TOKEN>")) as client:
    entities = client.web.entities.list(limit=10)
    overview = client.web.aggregates.entity_overview("my-entity-id")
    print(entities)
    print(overview.tasks)

Data Cloud API only

from getdx import DXClient, DXDataCloudConfig

with DXClient(
    data_cloud=DXDataCloudConfig(
        token="<DX_DATA_CLOUD_TOKEN>",
        instance="yourinstance",
    )
) as client:
    group = client.data_cloud.repo_groups.get(reference_id="frontend-team")
    print(group)

Both APIs in one client

from getdx import DXClient, DXDataCloudConfig, DXWebConfig

with DXClient(
    web=DXWebConfig(token="<DX_WEB_API_TOKEN>"),
    data_cloud=DXDataCloudConfig(token="<DX_DATA_CLOUD_TOKEN>", instance="yourinstance"),
) as client:
    web_entity = client.web.entities.info("entity-1")
    repo_group = client.data_cloud.repo_groups.get(reference_id="frontend-team")

Data Cloud convenience helpers

  • client.data_cloud.custom_data.delete_by_id(id)
  • client.data_cloud.custom_data.delete_by_reference_key(reference, key)
  • client.data_cloud.deployments.set_pull_services_by_github_pull_id(...)
  • client.data_cloud.deployments.set_pull_services_by_repo_and_number(...)

Optional namespace behavior

If web or data_cloud was not configured on DXClient, accessing that namespace raises DXClientNotConfiguredError.

Environment variables

  • DX_WEB_API_TOKEN for Web API token fallback
  • DX_DATA_CLOUD_TOKEN for Data Cloud token fallback
  • DX_DATA_CLOUD_INSTANCE for Data Cloud instance fallback

Development

Clone and install with uv:

git clone https://github.com/priiiiit/dx-python.git
cd dx-python
uv sync --dev

Regenerate API wrappers

Generated modules live under:

  • src/getdx/web/ (operations.py, services/)
  • src/getdx/data_cloud/ (operations.py, services/)
uv run python scripts/generate_from_openapi.py \
  --api-name web \
  --spec specs/dx_web_api_openapi.json

uv run python scripts/generate_from_openapi.py \
  --api-name data_cloud \
  --spec specs/dx_data_cloud_api_openapi.json

Testing and linting

uv run ruff format .
uv run ruff check .
uv run pytest

Optional live smoke tests:

RUN_LIVE_DX_TESTS=1 uv run pytest tests/live -q

For Data Cloud live smoke, set:

  • DX_DATA_CLOUD_TOKEN
  • DX_DATA_CLOUD_INSTANCE
  • DX_DATA_CLOUD_TEST_REFERENCE_ID

License

MIT — 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

getdx-0.1.0.tar.gz (81.1 kB view details)

Uploaded Source

Built Distribution

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

getdx-0.1.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file getdx-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for getdx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 785bb3b5e8abcf26ebdde9558622e029bcf8c683132f7bb5c62f3be4bd49e56a
MD5 fe2f2325eb5096dc13001753cd5e822b
BLAKE2b-256 b8ff21c975e14438a0f12a0c110cf452e463114b9c1ac578734204f2b4ada46b

See more details on using hashes here.

Provenance

The following attestation bundles were made for getdx-0.1.0.tar.gz:

Publisher: publish.yml on priiiiit/dx-python

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

File details

Details for the file getdx-0.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for getdx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8fdf24c94b8a4755c5ca396cc2e231c1f31ddc3aa5edd9af68f89809daff3e9
MD5 ea582e57fc18c3b991dce1f58c2de86c
BLAKE2b-256 9982b55ce3e9f95e5caa538b76fec31e9b7f02f50e88bc94a1754783c449d92a

See more details on using hashes here.

Provenance

The following attestation bundles were made for getdx-0.1.0-py3-none-any.whl:

Publisher: publish.yml on priiiiit/dx-python

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