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.
Metadata
Release files for jma-client 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jma-client-0.0.1.tar.gz | 8.6 kB | Without provenance | Details for jma-client-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jma_client-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for jma_client-0.0.1-py3-none-any.whl |
Total release size: 18.9 kB
Release files / jma-client-0.0.1.tar.gz
| Download URL | jma-client-0.0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
237081e83b8655a3beeca80723421d6238321cb423475997cf25becd8a67183a
|
|
BLAKE2b-256 checksum How to use checksums |
ee815440b42315a38caa9d1af0344c0a4ec2873bcb983a8e358464b02c108601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / jma_client-0.0.1-py3-none-any.whl
| Download URL | jma_client-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e331ba72fd70a1314512a477794ef869994d086d29dfa12daf951bdeaf28d38e
|
|
BLAKE2b-256 checksum How to use checksums |
62497af72617d79d2ce1a73a078955424ab7ff92e769070172d953da80fc3504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for jma-client 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.