-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# search | ||
|
||
## Overview | ||
|
||
Search for data using specified keywords. | ||
The search uses the [データカタログ横断検索サイト](https://search.ckan.jp) API. | ||
If multiple keywords are used, specify space-separated strings. | ||
|
||
```bash | ||
dim search [options] <keyword> | ||
``` | ||
|
||
## Option | ||
|
||
### -n, --number \<num\> | ||
|
||
**optional** | ||
Specifies the maximum data set to be retrieved during a search. | ||
A number between 1 and 100 can be specified. | ||
The default value is set at 10. | ||
|
||
### -i, --install | ||
|
||
**optional** | ||
Interactive data download from search results. | ||
In interactive installations, data retrieval, | ||
acquisition and post-processing are specified interactively. | ||
|
||
#### Selecting the data to be installed | ||
|
||
Select the data you want to download from the search results. | ||
The data selection uses a number allocated to each search result data. | ||
The numbers are in the form `1.[Data name]`. | ||
|
||
#### Specify name | ||
|
||
Specify a unique name to identify the data. | ||
Used in `update`, `uninstall` commands, etc., to specify the data to be processed. | ||
Also used as the name of a subdirectory when storing data under the `data_files` directory. | ||
If unspecified, it is automatically generated from the `xckan_title` of the search result and the `name` in the `resources`. | ||
|
||
#### Specify post-processing | ||
|
||
Specify post-processing for downloaded files. | ||
(Multiple designations possible) | ||
|
||
| process name | description | | ||
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| unzip | Unzip the downloaded zip file in the current directory. | | ||
| encode \<code\> | Change the character encoding of the downloaded file.<br>Corresponding code:UTF-16, UTF-16BE, UTF-16LE, UTF-8, ISO-2022-JP, Shift_JIS, EUC-JP, UNICODE | | ||
| xlsx-to-csv | Generate downloaded xlsx files converted to csv files under the data_files distribution. | | ||
| cmd \<command\> | Execute the command with the path of the downloaded file as an argument. | | ||
|
||
### Examples | ||
|
||
``` | ||
# Search by specifying one keyword. | ||
dim search "東京" | ||
# Search by specifying two keywords. | ||
dim search "東京 人口" | ||
# Show only one retrieved dataset. | ||
dim search -n 1 "東京" | ||
# [title] | ||
# - Catalog URL : URL of the site where the dataset is published | ||
# - Catalog Description : Description of data set | ||
# - Catalog License : licence | ||
# 1. [Data name] | ||
# * Resource URL : URL of the resource | ||
# * Resource Description : Description of resource | ||
# * Created : creation day | ||
# * Format : File format | ||
# 2. [Data name] | ||
# . | ||
# . | ||
# . | ||
# . | ||
# | ||
# [title] | ||
# . | ||
# . | ||
# . | ||
# . | ||
``` | ||
|
||
``` | ||
# Interactively download data from retrieved datasets | ||
dim search -i "東京" | ||
# Specify the number of the data you want to download. | ||
? Enter the number of the data to install › 1 | ||
# Specify a unique name. | ||
? Enter the name. Enter blank if want to use CKAN resource name. › example | ||
# Specify of post-processing. | ||
? Enter the post-processing you want to add. Enter blank if not required. › encode utf-8 | ||
# Confirmation of additional post-processing. | ||
? Is there a post-processing you would like to add next? (Y/n) › No | ||
``` |