Skip to main content

zutool

PyPI version CI Release

ghcr latest ghcr size

Unofficial zutool (頭痛ール: https://zutool.jp/) API Wrapper

Install

pipx install zutool
# or,
pip install zutool

As Library

import zutool as z

# see: <https://nlftp.mlit.go.jp/ksj/gml/codelist/PrefCd.html>
area_code = "13" # 東京都
z.get_pain_status(area_code)

keyword = "東京都"
z.get_weather_point(keyword)

# see: <https://geoshape.ex.nii.ac.jp/city/code/?13113>
city_code = "13113" # 東京都渋谷区
z.get_weather_status(city_code)

city_code = "13101" # 東京都千代田区
z.get_otenki_asp(city_code)

As CLI

$ zutool -h
usage: zutool [-h] [-j] {pain_status,ps,weather_point,wp,weather_status,ws,otenki_asp,oa} ...

Get info of zutool <https://zutool.jp/>.

positional arguments:
  {pain_status,ps,weather_point,wp,weather_status,ws,otenki_asp,oa}
    pain_status (ps)          get pain status by prefecture
    weather_point (wp)        search weather point
    weather_status (ws)       get pain status by city
    otenki_asp (oa)           get weather infomations

optional arguments:
  -h, --help                  show this help message and exit
  -j, --json                  print as json (default: False)

pain_status (ps)

$ zutool ps -h
usage: zutool pain_status [-h] [-s CODE] area_code

positional arguments:
  area_code   see: <https://nlftp.mlit.go.jp/ksj/gml/codelist/PrefCd.html> (ex. `13`)

optional arguments:
  -h, --help  show this help message and exit
  -s CODE     set weather point code as default (ex. `13113`) (default: None)
$ zutool ps 01
             今のみんなの体調は? <北海道|01>
                 (集計時間: 12時-18時台)
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ 😃😃😃😃😃😃😃😃 17.098445595855%                      ┃
┃ 😐😐😐😐😐😐😐😐😐😐😐😐😐😐😐 31.60621761658%         ┃
┃ 😞😞😞😞😞😞😞😞😞😞😞😞😞😞😞😞😞😞 37.823834196891%  ┃
┃ 🤯🤯🤯🤯🤯🤯 13.471502590674%                          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ [😃・・・普通, 😐・・・少し痛い, 😞・・・痛い, 🤯・・・かなり痛い] │
└────────────────────────────────────────────────────────┘

weather_point (wp)

$ zutool wp -h
usage: zutool weather_point [-h] [-k] keyword

positional arguments:
  keyword     keyword for searching city_code (ex. `東京都`)

optional arguments:
  -h, --help  show this help message and exit
  -k, --kata  with kata column in non-json output (default: False)
$ zutool wp "港区"
        「港区」の検索結果
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓
┃ 地域コード ┃ 地域名             ┃
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩
│ 13103      │ 東京都港区         │
│ 23111      │ 愛知県名古屋市港区 │
│ 27107      │ 大阪府大阪市港区   │
└────────────┴────────────────────┘

weather_status (ws)

$ zutool ws -h
usage: zutool weather_status [-h] [-n N [N ...]] city_code

positional arguments:
  city_code     see: <https://geoshape.ex.nii.ac.jp/city/code/> (ex. `13113`)

optional arguments:
  -h, --help    show this help message and exit
  -n N [N ...]  specify day number to show (default: [0])
$ zutool ws 13113
                                                   <東京都渋谷区|13113>の気圧予報
                                                  today = 2023-08-15 20:00:00+09:00 
┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓
┃ 0        ┃ 1        ┃ 2        ┃ 3        ┃ 4        ┃ 5        ┃ 6        ┃ 7        ┃ 8        ┃ 9        ┃ 10       ┃ 11       ┃
┡━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩
│ ☁        │ ☁        │ ☔       │ ☔       │ ☁        │ ☔       │ ☁        │ ☁        │ ☔       │ ☔       │ ☁        │ ☁        │
│ 28.4℃    │ 27.5℃    │ 27.3℃    │ 26.5℃    │ 26.9℃    │ 26.7℃    │ 26.9℃    │ 27.9℃    │ 28.4℃    │ 28.4℃    │ 29.1℃    │ 30.7℃    │
│ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │ ↗        │
│ 1004.8   │ 1004.2   │ 1004.3   │ 1004.3   │ 1004.6   │ 1004.9   │ 1005.2   │ 1005.4   │ 1005.8   │ 1006.0   │ 1005.8   │ 1005.3   │
│ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │ やや警戒 │
└──────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────┴──────────┘
┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓
┃ 12       ┃ 13       ┃ 14       ┃ 15     ┃ 16     ┃ 17     ┃ 18     ┃ 19     ┃ 20     ┃ 21       ┃ 22       ┃ 23       ┃
┡━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩
│ ☁        │ ☀        │ ☀        │ ☀      │ ☀      │ ☔     │ ☁      │ ☁      │ ☔     │ ☔       │ ☔       │ ☔       │
│ 31.1℃    │ 32.2℃    │ 31.9℃    │ 31.6℃  │ 31.3℃  │ 29.9℃  │ 29.3℃  │ 29.2℃  │ 28.4℃  │ 27.9℃    │ 27.5℃    │ 27.2℃    │
│ ↗        │ ↗        │ ↗        │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗        │ ↗        │ ↗        │
│ 1005.1   │ 1004.9   │ 1004.9   │ 1004.6 │ 1004.7 │ 1004.8 │ 1005.2 │ 1005.7 │ 1006.3 │ 1006.5   │ 1006.5   │ 1006.4   │
│ やや警戒 │ やや警戒 │ やや警戒 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ やや警戒 │ やや警戒 │ やや警戒 │
└──────────┴──────────┴──────────┴────────┴────────┴────────┴────────┴────────┴────────┴──────────┴──────────┴──────────┘

otenki_asp (oa)

$ zutool oa -h
usage: zutool otenki_asp [-h] [-n N [N ...]] {01101,04101,13101,15103,17201,23106,27128,34101,39201,40133,47201}

positional arguments:
  {01101,04101,13101,15103,17201,23106,27128,34101,39201,40133,47201}
                                                  see: <https://geoshape.ex.nii.ac.jp/city/code/> (ex. `13113`)

optional arguments:
  -h, --help                                      show this help message and exit
  -n N [N ...]                                    specify day number to show (default: [0, 1, 2, 3, 4, 5, 6])
$ zutool oa 13101
                                            <東京|13101>の天気情報
┏━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ 日付  ┃ 天気       ┃ 降水確率 ┃ 最高気温 ┃ 最低気温 ┃ 最大風速 ┃ 最大風速時風向 ┃ 気圧予報レベル ┃ 最小湿度 ┃
┡━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ 08/02 │ 晴れ       │ 10.0     │ 35.0     │ 26.0     │ 11.2     │ 8.0            │ 2.0            │ 60.5     │
│ 08/03 │ 晴れ       │ 10.0     │ 36.0     │ 26.0     │ 11.8     │ 8.0            │ 4.0            │ 63.6     │
│ 08/04 │ 晴れ       │ 0.0      │ 36.0     │ 26.0     │ 10.0     │ 8.0            │ 2.0            │ 59.6     │
│ 08/05 │ 晴れのち雨 │ 30.0     │ 36.0     │ 27.0     │ 11.8     │ 8.0            │ 1.0            │ 64.3     │
│ 08/06 │ 雨のち晴れ │ 30.0     │ 36.0     │ 27.0     │ 10.3     │ 8.0            │ 2.0            │ 61.9     │
│ 08/07 │ 晴れのち雨 │ 50.0     │ 33.0     │ 26.0     │ 7.2      │ 2.0            │ 2.0            │ 63.6     │
│ 08/08 │ 雨一時晴れ │ 80.0     │ 33.0     │ 26.0     │ 6.2      │ 6.0            │ 1.0            │ 79.5     │
└───────┴────────────┴──────────┴──────────┴──────────┴──────────┴────────────────┴────────────────┴──────────┘

Metadata

Release files for zutool 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zutool 0.3.2
File Size Uploaded
zutool-0.3.2.tar.gz 12.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zutool 0.3.2
File Interpreter ABI Platform
zutool-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / zutool-0.3.2.tar.gz

Download URL zutool-0.3.2.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
29c89fb00a49f23ecc39fc0d50674bff7e0f13feeea6eddc617d381a5cbdcb32
BLAKE2b-256 checksum
How to use checksums
b36e8725fc874a083fc5a1f9667ecd273be772acda11344829f5682bfc8aa2cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zutool-0.3.2-py3-none-any.whl

Download URL zutool-0.3.2-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75b40a9c28be39be542207a3c718c5d256f29d7aa90179cd78cc9acbac08cbca
BLAKE2b-256 checksum
How to use checksums
81c29da645e0e27233ecf8d319b91926269050cdfd9f631cc9c179cd2c019a30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page