Skip to main content

Downloads PyPI version

tdq

Treasure Data Query shell

Install

pip install tdq

Features

A wrapper for td-client that focus on SQL query with following features

  • bash-like history-list editing (e.g. Control-P scrolls back to the last command, Control-N forward to the next one, Control-F moves the cursor to the right non-destructively, Control-B moves the cursor to the left non-destructively, etc.).
  • directly execute SQL to the remote TD endpoint
  • support multi-line queries
  • support horizontal, vertical and CSV format ouput

Usage

Start the shell with default configuration

tdq

or start the shell with a specific database

tdq -d sample_database

Exit the shell by quit command or Ctrl-D

See all the command parameters:

tdq --help

Run the shell with predefined sql queries and write the result ot a CSV file

tdq -f input.sql -o output.csv --output-format CSV_HEADER

Besides valid commands, all user's inputs are considered SQL queries.

Currently, below commands are supported:

  • use : change current database. This could be set by -d option or read from default TD client config file
  • display
  • quit: quit the shell (same with Ctrl-D)

Use -h to see all options

Configuration

tdq will utilize the file ~/.td/td.conf created by td-client for default configuration

For example, a typical td.conf looks like below:

[account]
  apikey = <apikey>
  endpoint = https://api.treasuredata.co.jp/
  database = <default database>

Alternately, apikey and endpoint could be defined by environmental variables TD_API_KEY and TD_SERVER Endpoint also could be defined by -e option from command line.

Other

  • see here for details about Treasure Data Python client

Metadata

Release files for tdq 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tdq 0.1.8
File Interpreter ABI Platform
tdq-0.1.8-py3-none-any.whl Python 3 none any Details

Release files / tdq-0.1.8-py3-none-any.whl

Download URL tdq-0.1.8-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
720e8e0ef156f9a0a0061d1dacb8c0ce5b472b3e9a9468adaea900a6df7ad568
BLAKE2b-256 checksum
How to use checksums
1273f7a9dfe3c84966852a1ad136f58630b07e9c7f5ad19f27bf59a06b3c6e19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.1.8 This release

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page