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.1.tar.gz (81.8 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.1-py3-none-any.whl (33.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: getdx-0.1.1.tar.gz
  • Upload date:
  • Size: 81.8 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.1.tar.gz
Algorithm Hash digest
SHA256 bd7f1bee3ad4c74be932cf4c730531b5cb6beb15f5c844fd847ca3712bc5f61c
MD5 0b687dd036c6bd69b4d2a0fc9e236bfc
BLAKE2b-256 b19760ab0b7eab0ed4e2a03fa894def86867ae4ffdfc1a89eac86a86b5438c37

See more details on using hashes here.

Provenance

The following attestation bundles were made for getdx-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: getdx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 33.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a98af85e1a905d45781718df6b456f9b3a3d98152372e814ed9e4c4e93ccdc78
MD5 9e68fae113ab9e0db638d5ef91f17313
BLAKE2b-256 718f34c85f5a98fef157a8298c23fb78e305d579555420792b471743c95634ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for getdx-0.1.1-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