Skip to main content

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

Project description

zutool

PyPI version Maintainability pre-commit.ci status Test Coverage Test

ghcr latest ghcr size

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

Install

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)

As CLI

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

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

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

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
                                           東京都渋谷区の気圧予報
                                          2023-07-26 03:00:00+09:00
┏━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
┃ 0      ┃ 1      ┃ 2      ┃ 3      ┃ 4      ┃ 5      ┃ 6      ┃ 7      ┃ 8      ┃ 9      ┃ 10     ┃ 11     ┃
┡━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
│ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │
│ 27.8℃  │ 28.2℃  │ 26.3℃  │ 26.2℃  │ 26.2℃  │ 26.2℃  │ 26.5℃  │ 27.3℃  │ 28.6℃  │ 30.1℃  │ 31.7℃  │ 33.2℃  │
│ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │
│ 1015.6 │ 1015.5 │ 1015.7 │ 1015.5 │ 1015.4 │ 1015.6 │ 1015.8 │ 1016.0 │ 1016.1 │ 1016.3 │ 1016.2 │ 1015.9 │
│ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │
└────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘
┏━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
┃ 12     ┃ 13     ┃ 14     ┃ 15     ┃ 16     ┃ 17     ┃ 18     ┃ 19     ┃ 20     ┃ 21     ┃ 22     ┃ 23     ┃
┡━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
│ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │ ☼      │
│ 34.5℃  │ 35.3℃  │ 35.7℃  │ 35.2℃  │ 33.9℃  │ 32.2℃  │ 30.4℃  │ 28.6℃  │ 27.2℃  │ 26.5℃  │ 26.3℃  │ 26.3℃  │
│ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │ ↗      │
│ 1015.5 │ 1014.9 │ 1014.3 │ 1013.9 │ 1013.8 │ 1013.8 │ 1014.2 │ 1014.7 │ 1015.4 │ 1016.0 │ 1015.8 │ 1015.9 │
│ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │ 通常_0 │
└────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┴────────┘

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

zutool-0.0.4.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

zutool-0.0.4-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file zutool-0.0.4.tar.gz.

File metadata

  • Download URL: zutool-0.0.4.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/5.15.0-1041-azure

File hashes

Hashes for zutool-0.0.4.tar.gz
Algorithm Hash digest
SHA256 10c44d7a09ff16b55288f704093b2d19e78ca370a2c9f96bf47d9fa086526f1b
MD5 3be184992e2b0a3ea34e87c5ca4f1561
BLAKE2b-256 57f40b8cdb39bca192112f75f5959cf7a2004cfc57ea8e1d278de28567c6d68a

See more details on using hashes here.

File details

Details for the file zutool-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: zutool-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.0 Linux/5.15.0-1041-azure

File hashes

Hashes for zutool-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7d713301da610d69903856c6b0b3608abc213cca16cf50d56a3e3d0ad34e360b
MD5 36866d509bf69152a50175c1dd316d2a
BLAKE2b-256 59532967c2936c1076a9933298f227d37a32e7ec823d63606ac1e348e28eebb7

See more details on using hashes here.

Supported by

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