Skip to main content

Himawari-8/9 downloader and file query SDK for FTP and S3.

Project description

himawari-downloader

English | 简体中文

PyPI version Python versions CI Publish PyPI License

himawari-downloader is a Python SDK and CLI for querying and downloading Himawari-8/9 data from FTP and S3.

Quick Links

English 简体中文
README 中文说明
Tutorial 中文教程
GitHub repository PyPI package

Documentation

Features

  • Unified HimawariDownloader API
  • Query modes: find, latest, closest, previous, next
  • Download modes: links, timestamps, dates, range
  • FTP support for netcdf and hsd
  • FTP NetCDF remote bbox and variable subset download
  • S3 file query and raw download
  • Optional proxy support for FTP and S3

What's New in v0.1.2

  • FTP whole-file NetCDF downloads now use a direct FTP binary transfer path for better robustness.
  • FTP NetCDF query candidates are filtered to existing remote files before being returned.
  • Added download progress event support in the SDK (DownloadEvent and DownloadParams.progress_callback).
  • NetCDF subset now supports full-disk variable export by combining:
    • NetcdfSubset(whole_file=True, target_vars=(...))

Installation

Base install:

pip install himawari-downloader

Install S3 support:

pip install "himawari-downloader[s3]"

Install FTP NetCDF subset support:

pip install "himawari-downloader[ftp-netcdf]"

Install everything:

pip install "himawari-downloader[all]"

For local development:

pip install -e ".[dev]"

Python usage

Basic FTP HSD download:

from himawari_downloader import DownloadParams, HimawariDownloader, QueryParams

client = HimawariDownloader(ftp_user="your_uid", ftp_password="your_password")

query = QueryParams(
    source="ftp",
    satellite="H09",
    product_level="L1B",
    product="Rad",
    sector="FLDK",
    mode="dates",
    data_format="hsd",
    dates=("2025-03-19",),
    bands=("B07", "B14"),
)

result = client.download(query, DownloadParams(out_dir="data/out"))
print(result.saved_paths)

FTP NetCDF subset example:

from himawari_downloader import DownloadParams, HimawariDownloader, NetcdfSubset, QueryParams

client = HimawariDownloader(ftp_user="your_uid", ftp_password="your_password")

query = QueryParams(
    source="ftp",
    satellite="H09",
    product_level="L2",
    product="NetCDF",
    sector="FLDK",
    mode="links",
    data_format="netcdf",
    remote_files=("/jma/netcdf/202503/19/NC_H09_20250319_0010_R21_FLDK.02401_02401.nc",),
)

result = client.download(
    query,
    DownloadParams(
        out_dir="data/out",
        netcdf_subset=NetcdfSubset(
            bbox_lat=(40.75, 34.44),
            bbox_lon=(110.27, 114.59),
            target_vars=("tbb_07",),
        ),
    ),
)

FTP NetCDF full-disk selected variable example:

```python
from himawari_downloader import DownloadParams, HimawariDownloader, NetcdfSubset, QueryParams

client = HimawariDownloader(ftp_user="your_uid", ftp_password="your_password")

query = QueryParams(
    source="ftp",
    satellite="H09",
    product_level="L2",
    product="NetCDF",
    sector="FLDK",
    mode="links",
    data_format="netcdf",
    remote_files=("/jma/netcdf/202503/19/NC_H09_20250319_0010_R21_FLDK.07001_06001.nc",),
)

result = client.download(
    query,
    DownloadParams(
        out_dir="data/out",
        netcdf_subset=NetcdfSubset(
            whole_file=True,
            target_vars=("tbb_07",),
        ),
    ),
)

Proxy example:

```python
from himawari_downloader import DownloadParams, ProxyConfig

params = DownloadParams(
    out_dir="data/out",
    proxy=ProxyConfig(
        url="http://127.0.0.1:7890",
        source_overrides={"s3": "http://127.0.0.1:7890"},
    ),
)

Band mapping and parameter quick reference

Band and channel names:

  • Use B01 to B16 in bands
  • If you already know C07, C14 style names from other tools, map them directly to B07, B14
  • For FTP NetCDF subset download, use NetCDF variable names in target_vars, not bands

Typical NetCDF variable mapping:

  • B07 -> tbb_07
  • B14 -> tbb_14

Important QueryParams fields:

  • source: ftp or s3
  • satellite:
    • FTP examples usually use H08 or H09
    • S3 examples usually use HIMAWARI-8 or HIMAWARI-9
  • product_level:
    • L1B for radiance segments
    • L2 for derived products
  • product:
    • FTP HSD usually uses Rad
    • FTP NetCDF currently uses NetCDF
    • S3 L2 examples include CMSK, CHGT, CPHS, RRQPE
  • sector: FLDK, Japan, Target
  • data_format: FTP only, hsd or netcdf
  • mode: links, timestamps, dates, range, latest, closest, previous, next
  • bands: tuple of Bxx, for example ("B07", "B14")
  • scene_abbr: optional regional scene filter like R1, R2, R3

Important DownloadParams fields:

  • out_dir: output directory
  • max_workers: number of concurrent downloads
  • retries: retry count
  • skip_existing: skip local files if they already exist
  • proxy: ProxyConfig(...)
  • ftp_block_size: FTP read block size
  • netcdf_subset: FTP NetCDF subset configuration

Important NetcdfSubset fields:

  • bbox_lat: latitude bounds
  • bbox_lon: longitude bounds
  • target_vars: NetCDF variable names such as ("tbb_07",)
  • whole_file: disable subsetting and download the entire file
  • compression_level: output NetCDF compression level
  • fallback_full_download: if subset download fails, try full download

Detailed tutorial:

The tutorial also includes:

  • product capability matrix
  • cookbook recipes by task
  • FAQ and common error guide

CLI

himawari-download find \
  --source ftp \
  --satellite H09 \
  --product-level L1B \
  --product Rad \
  --sector FLDK \
  --mode dates \
  --data-format hsd \
  --dates 2025-03-19

More CLI and task-oriented examples are documented in:

Test

python -m pytest -q

Build

python -m build
python -m twine check dist/*

Release

GitHub repository:

  • https://github.com/P-Coke/himawari-downloader

PyPI publishing is configured through GitHub Actions trusted publishing.

To release:

  1. Push changes to main
  2. Create and push a version tag like v0.1.0
  3. GitHub Actions will build and publish to PyPI

Acknowledgments

This project was developed with design inspiration from ghiggi/himawari_api, especially around Himawari file discovery workflows and query semantics such as latest, closest, previous, and next.

himawari_api is distributed under the MIT License. This project is an independent implementation and does not vendor or copy that codebase.

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

himawari_downloader-0.1.3.tar.gz (24.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

himawari_downloader-0.1.3-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file himawari_downloader-0.1.3.tar.gz.

File metadata

  • Download URL: himawari_downloader-0.1.3.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for himawari_downloader-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b95c09ec171a06a2229aae7000788baf554e50b3a06e6530e9003347802a78e1
MD5 20bdf8ce9fe9cee755bd75c5da1344f6
BLAKE2b-256 72f87eca308c3dc27544f42e424228ab63b358d5b3de79b0d4423fe2351364f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for himawari_downloader-0.1.3.tar.gz:

Publisher: publish-pypi.yml on P-Coke/himawari-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file himawari_downloader-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for himawari_downloader-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5186911885381943d225caf8916de7ef105df4a6cca126456a164c721c16a6fd
MD5 3b19e4acc3ec05581842d3f19dd7bad0
BLAKE2b-256 e48ed336016f492a229d49fa828da4b0887725ebb334afa74ea4d19de9b7665a

See more details on using hashes here.

Provenance

The following attestation bundles were made for himawari_downloader-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on P-Coke/himawari-downloader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page