Skip to main content

Download data from Japanese Meteorological Association.

Project description

JMA Irradiation Data Client

About

The Japanese Meteorological Association provides free access to various weather measurements from weather stations across the country through an online portal. However, they do not provide an API.

This client can be used to programmatically download Global Irradiation data from their website.

Installation

$ pip install jma-client

Example Usage

Download daily irradiation data

from datetime import date
from jma import JmaClient, JmaStation

s = date(2020, 12, 31)
e = date(2021, 1, 2)
stations = (JmaStation.Fukuoka, JmaStation.Kagoshima)

with JmaClient() as c:
    response = c.get_daily_irradiation(s, e, stations)
    print('\t'.join(response.headers))
    for row in response.csv:
        print('\t'.join([str(row[hdr]) for hdr in response.headers]))

Result:

Date	Fukuoka	Kagoshima
2020-12-31	7.55	11.16
2021-01-01	2.53	9.27
2021-01-02	1.07	9.24

Download hourly irradiation data

from datetime import date
from jma import JmaClient, JmaStation

target_date = date(2021, 2, 23)
stations = [JmaStation.Nagano]
with JmaClient() as c:
    response = c.get_hourly_irradiation(target_date, target_date, stations)
    print('\t'.join(response.headers))
    for row in response.csv:
        print('\t'.join([str(row[hdr]) for hdr in response.headers]))

Result:

Date	Nagano
2021-02-23 00:00	None
2021-02-23 01:00	None
2021-02-23 02:00	None
2021-02-23 03:00	None
2021-02-23 04:00	None
2021-02-23 05:00	0.0
2021-02-23 06:00	0.03
2021-02-23 07:00	0.43
2021-02-23 08:00	1.14
2021-02-23 09:00	2.03
...(contd.)

Download daily irradiation data alongside average long-term values

from datetime import date
from jma import JmaClient, JmaStation

s = date(2021, 2, 1)
e = date(2021, 2, 14)
stations = [JmaStation.Aomori, JmaStation.Morioka]
with JmaClient() as c:
    response = c.get_daily_irradiation(s, e, stations, lta=True)
    print('\t'.join(response.headers))
    for row in response.csv:
        print('\t'.join([str(row[hdr]) for hdr in response.headers]))

Response:

Date	Aomori	Aomori_LT	Morioka	Morioka_LT
2021-02-01	9.43	6.3	10.88	8.5
2021-02-02	3.81	6.4	6.73	8.7
2021-02-03	4.4	6.5	8.95	8.8
2021-02-04	3.17	6.6	4.96	8.9
2021-02-05	5.11	6.7	10.63	9.0
2021-02-06	4.11	6.8	5.03	9.1
2021-02-07	4.77	6.9	4.88	9.2
2021-02-08	5.41	6.9	12.47	9.3
2021-02-09	4.82	7.0	12.16	9.4
2021-02-10	4.6	7.1	8.67	9.4
2021-02-11	7.35	7.2	10.9	9.5
2021-02-12	13.98	7.3	14.45	9.6
2021-02-13	14.4	7.5	12.58	9.7
2021-02-14	11.59	7.6	13.75	9.8

How do I find ID numbers for other JMA stations?

I've only gone through a small subset of all the available stations and included them in the JmaStation enumeration. If you wish to use stations that are not listed here, you will need to add them manually. This can be done by inspecting the request parameters when downloading CSV data from JMA using your browser's Developer Tools.

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

jma-client-0.0.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

jma_client-0.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file jma-client-0.0.1.tar.gz.

File metadata

  • Download URL: jma-client-0.0.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for jma-client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 237081e83b8655a3beeca80723421d6238321cb423475997cf25becd8a67183a
MD5 3ebec3cb33ab5ef45c35dc7df92cb3f3
BLAKE2b-256 ee815440b42315a38caa9d1af0344c0a4ec2873bcb983a8e358464b02c108601

See more details on using hashes here.

File details

Details for the file jma_client-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: jma_client-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for jma_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e331ba72fd70a1314512a477794ef869994d086d29dfa12daf951bdeaf28d38e
MD5 b614ebbda13abe26a60b9fe5dbd0a346
BLAKE2b-256 62497af72617d79d2ce1a73a078955424ab7ff92e769070172d953da80fc3504

See more details on using hashes here.

Supported by

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