pytd

pytd is a skill for Claude Code from treasure-data/td-skills. It costs 58 tokens per session (6,215 once invoked), scanned A, original, Apache-2.0.

A guide to using pytd, a Python SDK for querying Treasure Data and importing data from Python programs.

In plain words
What is it for?
Use it for Presto or Hive queries, pandas DataFrame imports, bulk uploads, and Python-based data analysis integrations.
Why use it?
It helps connect Python analysis workflows with Treasure Data without requiring users to build the query, import, or upload steps from scratch.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the sdk-skills plugin — 2 skills shipped together

Good fit Use it for Presto or Hive queries, pandas DataFrame imports, bulk uploads, and Python-based data analysis integrations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/treasure-data/td-skills/python
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add treasure-data/td-skills --skill python
Clone the repo
git clone --depth 1 https://github.com/treasure-data/td-skills

Made for: Claude Code.

Or install sdk-skills, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pytd

README.md
[![agentmods](https://agentmods.dev/badge/skills/treasure-data/td-skills/python/github.svg)](https://agentmods.dev/skills/treasure-data/td-skills/python)
Your own site
<a href="https://agentmods.dev/skills/treasure-data/td-skills/python"><img src="https://agentmods.dev/badge/skills/treasure-data/td-skills/python/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pytd

Your own site · 80×15
<a href="https://agentmods.dev/skills/treasure-data/td-skills/python"><img src="https://agentmods.dev/badge/skills/treasure-data/td-skills/python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,215 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.06215
Opus 5.5 $0.00023 $0.02486
Sonnet 5.5 $0.00012 $0.01243
Haiku 4.5 $0.00006 $0.00622

Measured 3mo ago against content hash f4dd6da826f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pytd scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sdk-skills/python/SKILL.md · 977 lines

How it starts

The opening of the file, as written. The whole thing — 977 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pytd - Treasure Data Python SDK

Expert assistance for querying and importing data to Treasure Data using pytd, the official Python driver for analytical workflows.

When to Use This Skill

Use this skill when:

  • Querying Treasure Data from Python scripts or Jupyter notebooks
  • Importing pandas DataFrames to TD tables
  • Running Presto or Hive queries from Python
  • Building data pipelines with Python and TD
  • Performing bulk data imports or exports
  • Migrating from deprecated pandas-td library
  • Integrating TD with Python data science workflows
  • Handling large result sets with iterative retrieval

Core Principles

1. Installation

Standard Installation:

pip install pytd

Requirements:

  • Python 3.9 or later
  • pandas 2.0 or later

2. Authentication & Configuration

Environment Variables (Recommended):

export TD_API_KEY="your_api_key_here"
export TD_API_SERVER="https://api.treasuredata.com/"

Client Initialization:

import pytd

# Using environment variables
client = pytd.Client(database='sample_datasets')

# Explicit credentials (not recommended for production)
client = pytd.Client(
    apikey='your_api_key',
    endpoint='https://api.treasuredata.com/',
    database='your_database',
    default_engine='presto'  # or 'hive'
)

Configuration Options:

  • apikey: TD API key (read from TD_API_KEY env var if not specified)
  • endpoint: TD API server URL (read from TD_API_SERVER env var)
  • database: Default database name for queries
  • default_engine: Query engine - 'presto' (default) or 'hive'

Regional Endpoints:

  • US: https://api.treasuredata.com/
  • Tokyo: https://api.treasuredata.co.jp/
  • EU: https://api.eu01.treasuredata.com/

3. Querying Data

Basic Query Execution
import pytd

client = pytd.Client(database='sample_datasets')

# Execute Presto query
result = client.query('SELECT symbol, COUNT(1) as cnt FROM nasdaq GROUP BY symbol LIMIT 10')

# Result format: {'columns': ['symbol', 'cnt'], 'data': [['AAIT', 590], ['AAL', 82], ...]}
print(result['columns'])  # ['symbol', 'cnt']
print(result['data'])     # [['AAIT', 590], ['AAL', 82], ...]

Read the full file on GitHub · 977 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 977 lines · 58 tokens per session scan A f4dd6da826f8

Subscribe to this mod's changes

pytd is a skill published in the GitHub repository treasure-data/td-skills (23 stars, last pushed 2d ago), licensed Apache-2.0. It adds 58 tokens to every session and 6,215 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

pytd compared with skills from other repositories

pytd next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pytdtreasure-data/td-skillsSkill232d agoApache-2.0A58Claude Code
pytorch-patternsaffaan-m/ECCSkill315kyesterdayMITA32Claude Code, Kiro
accelerateNousResearch/hermes-agentSkill268ktodayMITA13Claude Code, Codex
optimize-for-gpuK-Dense-AI/scientific-agent-skillsSkill59k3d agoMITA151Claude Code, Codex
developing-genkit-pythongoogle/skillsSkill25ktodayApache-2.0A96Claude Code, Codex
marimo-pairmarimo-team/marimoSkill24ktodayApache-2.0A57Claude Code, Codex
cudnn-installNVIDIA/skillsSkill4.3ktodayApache-2.0A49Claude Code, Codex