skillfed

td-client

Treasure Data API library for Python

td-client v1.7.0 370.2K downloads/30d#7,181 on PyPI
Permissive license Apache Software License AGING released

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-client

uv

uv add td-client

poetry

poetry add td-client

Installing 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

Development Status :: 4 - BetaEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet

Tags

treasure data python clienttreasure data api librarycloud data warehouse pythonquery treasure data from pythonbulk data import pythontreasure data job managementpython database api wrapper
data-warehouserest-clientbulk-import

More Internet packages