Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

wataruoguchi/covid19_nagano_csv_to_json

Repository files navigation

COVID-19 Nagano CSV to JSON

What's this

長野県が公開している CSV ファイルをダウンロードし、再利用可能な JSON へ変換するスクリプトです。

The script that downloads open data "CSV" files and convert them into reusable JSON files.

How to run

このスクリプトは GitHub Actions で毎時実行され、長野県の公表しているデータの取得を試みます。 It's running every hour by GitHub Actions, to try fetching new CSV files then update files under src/.encoded and src/.json automatically.

Locally...

ローカル環境で実行する場合。

$ yarn start

Specification

  1. 長野県の Web ページに公開されている "オープンデータ" 対象の 3 種類の CSV をダウンロードします。ダウンロードしたファイルは csv フォルダに保存されます。

    1. 200000_nagano_covid19_patients.csv : 新型コロナウイルス感染症対策に関するオープンデータ項目定義書 01 陽性患者属性に準拠。
    2. 200000_nagano_covid19_test_count.csv : 新型コロナウイルス感染症対策に関するオープンデータ項目定義書 03 検査実施件数の拡張版。
    3. 200000_nagano_covid19_call_center.csv : 新型コロナウイルス感染症対策に関するオープンデータ項目定義書 05 コールセンター相談件数の拡張版。
  2. CSV ファイルが SHIFT_JIS でエンコードされているため、UNICODE に変換します。変換されたファイルは encoded フォルダに保存されます。

  3. CSV ファイルに再利用しにくい行がいくつかあるので削除し、JSON に変換します。JSON ファイルは json フォルダに保存されます。

  4. 3 つのファイルより、data.json が生成され、同様に json フォルダに保存されます。

About the JSON file

1. patients.json

The specs following the original format of 新型コロナウイルス感染症対策に関するオープンデータ項目定義書 01 陽性患者属性.

2. test_count.json

The specs following the original format of 新型コロナウイルス感染症対策に関するオープンデータ項目定義書 03 検査実施件数, plus additional properties below.

Property Corresponding CSV Column Desc.
positiveNum 陽性_人数 陽性患者人数
negativeNum 陰性_人数 陰性性患者人数

3. call_center.json

The specs following the original format of 新型コロナウイルス感染症対策に関するオープンデータ項目定義書 05 コールセンター相談件数, plus additional properties below.

Property Corresponding CSV Column Desc.
hasSymptomNum 再掲:有症相談 Support type
safetyNum 再掲:海外旅行安全性 Support type
preventionNum 再掲:感染症予防 Support type
treatmentNum 再掲:感染症治療 Support type
actionNum 再掲:発症時対応 Support type
otherNum 再掲:その他 Support type

Where would it be used

About

Automation script that downloads & re-encodes Nagano Prefecture's open data CSV files, then converts it into JSON files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published