td-client
Treasure Data API library for Python
What it is and what it does
td-client is a Python wrapper around Treasure Data's REST API that lets you run queries, manage jobs, and import data into Treasure Data's cloud warehouse. It supports direct API calls and Database API compatibility for tools like pandas. The library includes comprehensive type hints for static type checking and handles streaming imports, bulk batch imports, and result retrieval.
You interact with Treasure Data through a Client context manager, passing your API key and choosing an endpoint. The package handles authentication, request formatting, and response parsing. It depends on python-dateutil, msgpack, and urllib3 for date handling, binary serialization, and HTTP requests respectively.
Use it for:
- Run SQL queries (Hive or Presto) against Treasure Data and retrieve results row-by-row in Python.
- List and monitor query jobs running on Treasure Data, checking status and retrieving results.
- Import CSV or JSON files into Treasure Data tables in streaming or batch mode with custom column type handling.
- Load Treasure Data query results into DataFrames using pandas with Database API compatibility.
- Bulk import msgpack-formatted data with error tracking and validation before committing to the warehouse.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for the Treasure Data REST API, enabling queries, job management, and data import to a cloud data warehouse.
Yes, if you use Treasure Data. The library is stable, has low install friction, carries no known vulnerabilities, and provides both raw API access and Database API compatibility. The 197-day release gap suggests maintenance is reactive rather than proactive, so verify that it still aligns with your Treasure Data API version before relying on it for production.
Install
td-client on PyPI
pip
pip install td-clientuv
uv add td-clientpoetry
poetry add td-clientInstalling td-client
Before you install
Low install friction with three common runtime dependencies. Package is aging (197 days since last release) but maintains stable support for Python 3.10 through 3.14 and PyPy.
License in practice
Apache Software License (permissive) allows use in most projects with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install td-client
import tdclient
with tdclient.Client() as td:
for job in td.jobs():
print(job.job_id)
Requires Python 3.10 or later. Treasure Data API key must be provided via TD_API_KEY environment variable or apikey= argument.
Verify before relying
- Whether the 197-day release gap indicates active maintenance or dormancy relative to Treasure Data's own API evolution.
- Current state of SSL certificate verification and whether certifi is still recommended or now bundled.
- Whether the package implements the full Python Database API v2.0 specification or a subset.
Package facts
| License | Apache Software License (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — python-dateutil, msgpack, urllib3 |
| Maintenance | aging — 197 days since the last release |
| First released | |
| Downloads | 370,233/month — #7,181 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: td_client-1.7.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
pandas-tdPandas-TD connects pandas DataFrames to…
permissive · top 15,000 on PyPI
pytdpytd provides Python interfaces to Treasure…
permissive · top 15,000 on PyPI
salesforce-bulkPython client library for the Salesforce Bulk…
permissive · top 5,000 on PyPI
Nasdaq-Data-LinkProvides Python access to Nasdaq Data Link's…
permissive · top 15,000 on PyPI
QuandlQuandl provides a Python client for accessing…
permissive · top 15,000 on PyPI
scrapinghubA Python client library for communicating with…
permissive · top 15,000 on PyPI
robin-stocksProvides a Python interface to the Robinhood,…
permissive · top 15,000 on PyPI
sqlite-utilsCLI tool and Python library for creating,…
permissive · top 5,000 on PyPI
hdbcliA PEP 249-compliant Python database driver for…
unclear · top 5,000 on PyPI
dbs3-pycurlProvides a Python client wrapper around pycurl…
permissive · top 15,000 on PyPI