The `td-client` Python library provides a wrapper for the Treasure Data API (REST API), allowing users to programmatically interact with Treasure Data services. It enables tasks such as managing databases and tables, issuing queries (including asynchronous execution), and performing bulk data imports. The library is currently at version 1.7.0 and is actively maintained with consistent updates.
pip install td-clientVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the `td-client` with an API key (preferably from an environment variable) and then lists the 20 most recent jobs in your Treasure Data account. It demonstrates basic client setup and interaction.
Verify that `td-client` is the correct library for your needs, especially if you intend to interact with the Treasure Data REST API. For pandas integration or direct database access, consider `pytd`.
Always use environment variables (`TD_API_KEY`, `TD_API_SERVER`) for sensitive information and flexible configuration. Ensure the API key is valid and the endpoint matches your Treasure Data region (e.g., `https://api.us01.treasuredata.com`).
Explicitly define `dtypes` (e.g., `{'col1': 'int'}`) or `converters` (e.g., `{'col2': int}`) when dealing with CSV/TSV data to ensure correct type conversion and prevent data integrity issues.Ensure `certifi` is installed (`pip install certifi`) to enable proper SSL certificate verification. If encountering SSL errors in a controlled environment, consult documentation for trusted certificate configurations rather than disabling verification outright.