Registry / http-networking / diracx-api

diracx-api

JSON →
library0.3.0pypypi✓ verified 24d ago

The DiracX Python API Client provides an interface for interacting with the DiracX API. It simplifies making requests, handling authentication, and processing responses for various DiracX services. The current version is 0.0.12, and as a rapidly evolving library targeting Python 3.11+, it experiences frequent updates.

pip install diracx-api
INSTALL
IMPORT
SIG · DIRACX-API
D
diracx-api
http-networkingpythonv0.3.0
Install
10.1s avg
Import
Disk
98MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.1a17 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 13.7s
py 3.11
✓ —
✓ 10.1s
py 3.12
✓ —
✓ 8s
py 3.13
✓ —
✓ 8.5s
py 3.9
✕ build_error
✕ build_error
98MB installed
● package 98MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DiracXClient
from diracx import DiracXClient
from diracx import DiracXClient

Initializes the DiracXClient using environment variables for credentials and lists available assets.

import os from diracx_api import DiracXClient # Ensure DIRACX_API_KEY and DIRACX_BASE_URL are set in your environment api_key = os.environ.get("DIRACX_API_KEY", "") base_url = os.environ.get("DIRACX_BASE_URL", "https://api.diracx.com") if not api_key: print("Warning: DIRACX_API_KEY environment variable not set. API calls may fail.") try: client = DiracXClient(api_key=api_key, base_url=base_url) # Example: List assets assets_response = client.assets.list_assets() if assets_response.success: print("Assets retrieved successfully:") for asset in assets_response.data: print(f" ID: {asset.asset_id}, Symbol: {asset.symbol}") else: print(f"Failed to retrieve assets: {assets_response.error_message}") except Exception as e: print(f"An error occurred during API interaction: {e}")
Debug
Known issues
breakingAs the library is in early development (version 0.0.x), breaking changes can be introduced in any patch release without a major version increment, affecting method signatures, return types, or data structures.
fix
Regularly check the GitHub repository's release notes for `diracx-api` before updating. Pin the exact version (`diracx-api==0.0.12`) in production environments to prevent unexpected breakages.
affects: 0.0.x
gotchaAPI key (`DIRACX_API_KEY`) and base URL (`DIRACX_BASE_URL`) are typically provided via environment variables. Failing to set `DIRACX_API_KEY` will result in authentication errors.
fix
Ensure `DIRACX_API_KEY` is correctly set in your environment. Optionally, set `DIRACX_BASE_URL` if you need to target a different endpoint; otherwise, it defaults to `https://api.diracx.com`.
affects: All versions
gotchaAll API responses are wrapped in a standard `success`/`error_message`/`data` structure. Direct access to `response.data` without checking `response.success` can lead to errors if the API call failed.
fix
Always check `response.success` before accessing `response.data`. Handle `response.error_message` for failed requests to understand the cause of the failure.
affects: All versions
Upgrade
Version history
0.3.0latest on PyPI · released Jul 7, 2026
Audit
Dependencies
requestsrequiredHandles underlying HTTP requests to the DiracX API.
Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
diracx-api — pip install diracx-api · libregistry