
[](https://badge.fury.io/py/tdq)
# 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 <database> : change current database. This could be set by -d option or read from default TD client config file
- display <mode>: change current display mode. Value is among `horizontal`,`vertical` or `None`(auto)
- 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:
```td.conf
[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](https://github.com/treasure-data/td-client-python) for details about Treasure Data Python client
Raw data
{
"_id": null,
"home_page": "https://github.com/bachng2017/tdq",
"name": "tdq",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "python treasuredata shell sql",
"author": "bachng",
"author_email": "bachng@gmail.com",
"download_url": "",
"platform": null,
"description": "\n[](https://badge.fury.io/py/tdq)\n\n\n# tdq\nTreasure Data Query shell \n\n## Install\n```\npip install tdq\n```\n\n## Features\nA wrapper for td-client that focus on SQL query with following features\n- 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.).\n- directly execute SQL to the remote TD endpoint\n- support multi-line queries\n- support horizontal, vertical and CSV format ouput\n\n## Usage\nStart the shell with default configuration\n```\ntdq\n```\n\nor start the shell with a specific database\n```\ntdq -d sample_database\n```\n\nExit the shell by `quit` command or Ctrl-D\n\n\n\nSee all the command parameters:\n```\ntdq --help\n```\n\nRun the shell with predefined sql queries and write the result ot a CSV file\n```\ntdq -f input.sql -o output.csv --output-format CSV_HEADER\n```\n\nBesides valid commands, all user's inputs are considered SQL queries.\n\nCurrently, below commands are supported:\n- use <database> : change current database. This could be set by -d option or read from default TD client config file\n- display <mode>: change current display mode. Value is among `horizontal`,`vertical` or `None`(auto)\n- quit: quit the shell (same with Ctrl-D)\n\nUse `-h` to see all options\n\n\n## Configuration\ntdq will utilize the file ~/.td/td.conf created by td-client for default configuration\n\nFor example, a typical td.conf looks like below:\n```td.conf\n[account]\n apikey = <apikey>\n endpoint = https://api.treasuredata.co.jp/\n database = <default database>\n```\n\nAlternately, apikey and endpoint could be defined by environmental variables `TD_API_KEY` and `TD_SERVER`\nEndpoint also could be defined by `-e` option from command line.\n\n\n\n## Other\n- see [here](https://github.com/treasure-data/td-client-python) for details about Treasure Data Python client\n\n\n",
"bugtrack_url": null,
"license": "Apache",
"summary": "A Treasure Data query shell",
"version": "0.1.8",
"project_urls": {
"Homepage": "https://github.com/bachng2017/tdq"
},
"split_keywords": [
"python",
"treasuredata",
"shell",
"sql"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1273f7a9dfe3c84966852a1ad136f58630b07e9c7f5ad19f27bf59a06b3c6e19",
"md5": "5a603371083b25c0592889ff5aec9e81",
"sha256": "720e8e0ef156f9a0a0061d1dacb8c0ce5b472b3e9a9468adaea900a6df7ad568"
},
"downloads": -1,
"filename": "tdq-0.1.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5a603371083b25c0592889ff5aec9e81",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11707,
"upload_time": "2023-11-11T07:52:09",
"upload_time_iso_8601": "2023-11-11T07:52:09.447934Z",
"url": "https://files.pythonhosted.org/packages/12/73/f7a9dfe3c84966852a1ad136f58630b07e9c7f5ad19f27bf59a06b3c6e19/tdq-0.1.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-11 07:52:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bachng2017",
"github_project": "tdq",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tdq"
}