The `yandex-query-client` is the official Python HTTP client for Yandex Query, an interactive, fully managed service for running analytical and streaming queries on structured and semi-structured data using a common SQL dialect (YQL). The current version is 0.1.4, indicating it is an early-stage but actively maintained library. Its release cadence is currently irregular, consistent with a newer project.
pip install yandex-query-client --upgradeVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Yandex Query client, create a simple SQL query, wait for its completion, and retrieve the results. It highlights the essential steps for basic interaction with the Yandex Query service. Ensure `YQ_IAM_TOKEN` and `YQ_FOLDER_ID` environment variables are set or replaced with actual values for authentication and operation within a specific Yandex Cloud folder.
Store IAM token and Folder ID in environment variables (`YQ_IAM_TOKEN`, `YQ_FOLDER_ID`). Implement logic to refresh IAM tokens if using temporary credentials, or configure service accounts with appropriate roles (e.g., `yq.editor`) for automated access.
Always pin the exact version (`yandex-query-client==0.1.4`) in production environments and thoroughly test updates before deployment. Refer to the GitHub repository's `CHANGELOG.md` (if available) or commit history for specific changes between versions.
Consult the Yandex Query Language (YQL) documentation for syntax and feature specifics when constructing queries. Test your YQL queries directly in the Yandex Cloud console before integrating them into your application if you encounter unexpected behavior.