Downloader for meteorological and ocean datasets
Project description
1. climdatapy
気象・海洋のデータセットをダウンロードするCLI/Pythonパッケージ。
2. Installation
Python 3.11以上が必要。
pipコマンドを使い、PyPIからインストールする。
$ pip install climdatapy
3. Usage
3.1. CLI
climdataコマンドでデータセットを管理する。
3.1.1. ダウンロード可能データセットを表示
$ climdata list
3.1.2. データセットをダウンロード
(例) 2024年1月1日から1月2日までのJRA3Qデータをダウンロードする。
$ climdata download JRA3Q --start_time 2024-01-01 --end_time 2024-01-02 --out ./JRA3Q --logfile jra3q.log --skip_existing
引数の説明は-hオプションで確認できる。
$ climdata download -h
usage: climdata download [-h] --start_time START_TIME --end_time END_TIME [--out OUT] [--logfile LOGFILE] [--skip_existing] dataset
Download files for a specified dataset and time range.
positional arguments:
dataset dataset name
options:
-h, --help show this help message and exit
--start_time START_TIME
start date (YYYY-MM-DD)
--end_time END_TIME end date (YYYY-MM-DD)
--out OUT output directory
--logfile LOGFILE logfile path
--skip_existing set for ignore existing files
3.1.3. 最新データをダウンロード
(例) 公開されている最新のJRA3Qデータをダウンロードする。
$ climdata update JRA3Q --out ./JRA3Q --logfile jra3q.log --skip_existing
引数の説明は-hオプションで確認できる。
$ climdata update -h
usage: climdata update [-h] [--out OUT] [--logfile LOGFILE] [--skip_existing] dataset
positional arguments:
dataset dataset name
options:
-h, --help show this help message and exit
--out OUT output directory
--logfile LOGFILE logfile path
--skip_existing set for ignore existing files
3.2. Pythonモジュール
各データセットは、抽象基底クラスclimdata.util.Datasetを継承したデータセット管理クラス(以下、管理クラス)を持つ。
climdatapy.get_manager関数で管理クラスを取得する。
import climdatapy
manager = climdatapy.get_manager("JRA3Q")
3.2.1. dowloadメソッド
任意の時間の範囲、変数などを選択し、ダウンロードする。
(例)
start_time = datetime(2025, 1, 1, 0)
end_time = datetime(2025, 1, 1, 6)
download_kw = {
"stats_type": ["all"],
"data_kind": ["all"],
"near_realtime": ["all"],
"stats_type": ["all"],
"std": ["true"],
"var": ["all"],
}
data_dir = Path("./data_new")
log_file_path = Path("./jra3q.log")
manager.download(
start_time,
end_time,
download_kw,
data_dir,
log_file_path,
exist_ok=True,
)
download_kwはデータセット固有の情報を辞書型で格納する。
詳細は各データセットの説明(doc)を参照。
3.2.2. download_allメソッド
指定できる最大限のdownload_kwをdownloadメソッドに与えるwrapper。
3.2.3. updateメソッド
取得できる最新の時刻のデータをダウンロードする。
(例)
manager.update(
download_kw,
data_dir,
log_file_path,
exist_ok=True,
)
3.2.4. update_allメソッド
指定できる最大限のdownload_kwをupdateメソッドに与えるwrapper。
3.3. 対応データセット
| source | ||
|---|---|---|
| JRA3Q | NCAR GDEX | 詳細 |
| NCEP Reanalysis1 | 京大生存圏DB | 詳細 |
| NCEP Reanalysis2 | 京大生存圏DB | 詳細 |
| OISST | NOAA NCEI | 詳細 |
| COBESST | JMA NEAR-GOOS | 詳細 |
| HIMSST | JMA NEAR-GOOS | 詳細 |
各データ使用の際の引用や謝辞等の規定はsourceを参照してください。
3.4. サンプルスクリプト
sample/download_JRA3Q.py |
JRA3Qのダウンロード |
sample/update_JRA3Q.py |
JRA3Qの更新 |
4. Author
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file climdatapy-0.3.0.tar.gz.
File metadata
- Download URL: climdatapy-0.3.0.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22a29a62b2aa55591433eacf3e38dcbc8f099fe40f4ea696736cc6b9aefa9829
|
|
| MD5 |
7302658229550549060371b8bee34168
|
|
| BLAKE2b-256 |
5f0c4a7e14b1ef672dc8a8d46f729b63d150b677d1ff348390686d9e1540909c
|
Provenance
The following attestation bundles were made for climdatapy-0.3.0.tar.gz:
Publisher:
publish.yml on sotomita/climdatapy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
climdatapy-0.3.0.tar.gz -
Subject digest:
22a29a62b2aa55591433eacf3e38dcbc8f099fe40f4ea696736cc6b9aefa9829 - Sigstore transparency entry: 1126255427
- Sigstore integration time:
-
Permalink:
sotomita/climdatapy@ddca481c2bb26b26da86fdc3239782ce22e14f49 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sotomita
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ddca481c2bb26b26da86fdc3239782ce22e14f49 -
Trigger Event:
release
-
Statement type:
File details
Details for the file climdatapy-0.3.0-py3-none-any.whl.
File metadata
- Download URL: climdatapy-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dc64939b244e161e18136adda86ae8ab9714497790740e6e1e797e50c637a26
|
|
| MD5 |
92f6b5059e713884ec4337a9334f73f1
|
|
| BLAKE2b-256 |
e760db5d064bcd786216a368956ffb9d3ab9e807adc1bf57f3b2ba252e5b3243
|
Provenance
The following attestation bundles were made for climdatapy-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on sotomita/climdatapy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
climdatapy-0.3.0-py3-none-any.whl -
Subject digest:
5dc64939b244e161e18136adda86ae8ab9714497790740e6e1e797e50c637a26 - Sigstore transparency entry: 1126255503
- Sigstore integration time:
-
Permalink:
sotomita/climdatapy@ddca481c2bb26b26da86fdc3239782ce22e14f49 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/sotomita
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ddca481c2bb26b26da86fdc3239782ce22e14f49 -
Trigger Event:
release
-
Statement type: