Skip to content

Commit

Permalink
Update search.md en
Browse files Browse the repository at this point in the history
  • Loading branch information
ta-Hirose committed Sep 27, 2022
1 parent 7095491 commit ebc97d2
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions doc/en/search.md
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
```

0 comments on commit ebc97d2

Please sign in to comment.