Code-First Manifest: Making Local Government Data AI-Ready and Developer-Friendly

どうも〜おかむーです! Today I want to talk about something close to my hacker heart: turning local government data and systems from PDFs into APIs you actually want to use. エンジニア的に言うと、データの機械可読化と標準化はインフラそのものなんですよ〜
- Local gov data often lives in PDFs or nonstandard CSVs, making reuse hard
- There are government pushes for standardization (Digital Agency, MIC) but gaps remain
- Concrete engineering fixes (schemas, OpenAPI, deployment patterns) can close gaps fast
結論
Local governments already publish lots of useful numbers (see e-Stat, Data StaRt, soumu.go.jp) but the delivery formats and interfaces are inconsistent. 要するに、データそのものはあるけど“API-first / schema-first”で再設計されていない。技術的な改善を進めれば、政策検証と市民利用が一気に拡大しますよね。
Report
現状観察(what's out there)
これ見てくださいよ:総務省の自治体システム標準化ページ(https://www.soumu.go.jp/...)やデジタル庁の施策案(https://digital.go.jp/policies/local_governments)は、標準化の旗を掲げているんですけど、実務ではPDF埋め込みや非正規CSVがまだ多い。内閣官房のAI-Ready資料(https://www.cas.go.jp/...)も機械可読性を求めてるんですけど、実装差が大きい。
問題点を技術的に整理すると:
- フォーマットの多様性(PDF、XLSX、CSVだが列名が不統一)
- スキーマ不在(データ型、コード表、JIS地域コードの扱いがバラバラ)
- API欠如または未整備(CORS、認証、ページングがない)
- メタデータ不足(更新日時、ライセンス、識別子が不明)
データ検証の視点(engineer checklist)
- Machine-readable? → YES/NO
- Schema available? → JSON Schema / CSVW recommended
- Stable IDs? → use JIS codes / official identifiers
- Time series alignment? → ISO8601 timestamps
- Licensing? → CC-BY ideally
具体的なコード例(小さくて実用的)
Pythonで非正規CSVを取り扱う例(pandas + dtype指定):
import pandas as pd
url = 'https://example.localgov.gov/data.csv'
dtypes = {'city_code': str, 'year': int, 'value': float}
df = pd.read_csv(url, dtype=dtypes)
df['date'] = pd.to_datetime(df['year'], format='%Y')
print(df.head())
APIを1本作るならOpenAPIで設計するとクライアントが簡単:
openapi: 3.0.1
info:
title: LocalGov Stats API
version: 1.0.0
paths:
/population:
get:
parameters:
- name: city_code
in: query
schema: {type: string}
- name: year
in: query
schema: {type: integer}
responses: { '200': { description: 'CSV/JSON time series' }}
政策の数値目標と実績のギャップを検証する方法
- 施策に紐づく指標をID化(例:policy_id + indicator_id)
- 期日と実績を時系列で紐付ける(baseline, target, actual)
- 欠損は必ずメタデータで説明(why missing)
これで、たとえば「標準化PMOツール」(総務省の取り組み参照: https://www.digital.go.jp/...)の報告データを取り込んで、施策ごとの達成率ダッシュボードを自動生成できるんです。
改善提案(工程ベース)
コスト感はクラウド+CI/CDで数百万円〜数千万円スコープ。自治体向けのテンプレートを作ればスケールするんです。
まとめ
- 政府の意思表示は進んでいるが、現場のデリバリーが追いついていない
- 機械可読化とAPI-firstで、政策の検証と市民利用が圧倒的に楽になる
- 小さな工程(スキーマ付与、OpenAPI、データカタログ)から始めれば効果が出る
おかむーから一言
テクノロジーで行政がもっとオープンになるの、めっちゃワクワクするんですよ!小さな標準化投資で市民サービスが何倍にも伸びます、やりましょう!
Sources
- https://www.zhihu.com/question/659922888
- https://www.digital.go.jp/policies/local_governments
- https://www.zhihu.com/question/418844521
- https://www.soumu.go.jp/menu_seisaku/chiho/jichitaijoho_system/index.html
- https://www.zhihu.com/question/1998674473453364460
- https://www.zhihu.com/question/290714454
- https://okamu.ro/insight/ai-ready-administrative-data-checklist
- https://www.zhihu.com/question/6430289390
- https://www.cas.go.jp/jp/seisaku/digital_gyozaikaikaku/data8/data8_siryou1.pdf
- https://www.zhihu.com/question/38923279
- https://ja.wikipedia.org/wiki/%E5%85%AC%E5%85%B1
- https://www.intec.co.jp/column/smartcity-08.html
- https://kotobank.jp/word/%E5%85%AC%E5%85%B1-494676
- https://www.stat.go.jp/dstart/case/
- https://adtechmanagement.com/minnadepr-column/2025/11/02/koukyou-toha/
Share
Related Reports

Code-driven Manifesto: Auditing Local Gov Data and Systems (Kagawa case study)
Local gov systems run but hide data behind UIs; expose CSV/JSON, APIs, and common schemas to unlock value.

Code-driven Check: Japan’s Open Data and the Machine-Readable Gap
Digital Japan has dashboards and rules, but PDFs and messy formats still block automated policy verification; mandate CSV/JSON, APIs, and dataset linting.

Code Speaks: Testing Japan's Gov Data and Dashboards
Japan has great dashboards but inconsistent machine-readability. This report inspects e-Stat, Japan Dashboard, Kantei PDFs, and proposes API-first fixes and practical code examples.