Skip to content

code4fukui/localgovjp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

localgovjp

日本語のREADMEはこちらです: README.ja.md

An open dataset of all local governments in Japan, including prefectures, cities, wards, towns, and villages.

Sample Applications

Available Data

The data is available in both CSV and JSON formats, hosted via GitHub Pages for easy use in web applications.

Municipalities (Cities, Wards, Towns, Villages)

Prefectures

Data Schema

Municipalities (localgovjp)

Field Description
pid Prefecture ID
pref Prefecture Name
cid City ID
city City Name
citykana City Name (Kana)
lat Latitude
lng Longitude
url City Website URL
phrase Catchphrase
lgcode Local Government Code

Prefectures (prefjp)

Field Description
pid Prefecture ID
pref Prefecture Name
prefkana Prefecture Name (Kana)
pref_en Prefecture Name (English)
url Prefecture Website URL
lgcode Local Government Code
ISO3166-2 ISO 3166-2 Code (e.g., JP-01)

How to Update Data

This project uses Deno for data processing and updates.

Municipalities (localgov)

  1. Generate an intermediate file for review: cd deno; deno -A chk-localgov.js
  2. Manually check for errors and edit the generated deno/c-localgovjp-utf8.csv.
  3. Generate the final data files (.csv, .json, .js): cd deno; deno -A make-localgov.js
  4. Sign the data using OpendataWithTrust (requires PRIKEY in .env): cd deno; deno -A --env-file=.env sign-localgov.js

Prefectures (pref)

  1. Generate an intermediate file for review by running the appropriate check script.
  2. Manually check for errors and edit the generated deno/c-prefjp-utf8.csv.
  3. Generate the final data files (.csv, .json, .js) by adapting deno/make.js.
  4. Sign the data using OpendataWithTrust (requires PRIKEY in .env): cd deno; deno run -A --env-file=.env sign-pref.js

How to Verify Data

You can verify the integrity of the data files using OpendataWithTrust.

deno run --allow-read --allow-net https://code4fukui.github.io/opendata-with-trust/verifyTrust.js localgovjp-utf8.csv
deno run --allow-read --allow-net https://code4fukui.github.io/opendata-with-trust/verifyTrust.js localgovjp.json
deno run --allow-read --allow-net https://code4fukui.github.io/opendata-with-trust/verifyTrust.js prefjp-utf8.csv
deno run --allow-read --allow-net https://code4fukui.github.io/opendata-with-trust/verifyTrust.js prefjp.json

Data Sources

Update

  • 2016-11-29 Checked and updated all websites
  • 2017-02-18 Removed duplicate entry for Tomari Village
  • 2019-01-01 Updated
  • 2020-01-04 Updated
  • 2020-04-17 Updated
  • 2021-01-20 Updated
  • 2021-06-02 Changed Nakagawa Town, Fukuoka Prefecture to Nakagawa City, Fukuoka Prefecture
  • 2021-06-30 Fixed incorrect location information for the Kihoku Town Office, Kitamuro District, Mie Prefecture
  • 2021-07-19 Fixed the location of Etajima City, Hiroshima Prefecture
  • 2021-10-31 Updated prefecture URLs and added ISO 3166-2
  • 2021-11-01 Updated municipality URLs and added local government codes (lgcode)
  • 2023-03-09 Updated municipality URLs
  • 2026-01-01 Updated municipality URLs
  • 2026-03-09 Updated municipality URLs
  • 2026-07-09 Updated municipality URLs

License

About

list of local government in Japan (日本の地方自治体一覧オープンデータ) JSON/CSV

Resources

Stars

33 stars

Watchers

3 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors