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-apiVerified import paths — ran on the pinned version, not inferred.
Initializes the DiracXClient using environment variables for credentials and lists available assets.
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.
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`.
Always check `response.success` before accessing `response.data`. Handle `response.error_message` for failed requests to understand the cause of the failure.