Code for the Manifesto: Reading Japan's Digital Grants and Open Data as Code

IT Policy Proposals
Code for the Manifesto: Reading Japan's Digital Grants and Open Data as Code

どうも〜おかむーです! Today I'm digging into how Japan's government data — from Digital Den'en Toshi grants to scattered CSVs on gov sites — actually looks when you treat policies as code. エンジニア的に言うと、policy = spec, data = runtime, so if the spec isn't machine-readable, it's brittle and slow to iterate!

  • The Digital Den'en Toshi grant program publishes KPIs in PDFs and municipal sheets, but machine-readability is uneven.
  • Several gov CSV endpoints exist (notice.go.jp, env.go.jp, soumu.go.jp), but formats and metadata are inconsistent.
  • Practical fixes: central API, JSON-LD schemas for KPIs, CI for data quality, and sample ETL code to measure target-vs-actual gaps.

結論

Japan has the raw materials for data-driven policy verification — CSVs, KPI sheets, and emerging "Data for AI" initiatives — but the ecosystem is fragmented. 要するに、PDFs and inconsistent CSVs block automation and auditability. Engineer-ish remedies (APIs, schema, CI, documented license) would let researchers and civic tech build reliable accountability tools fast.

Report: what I found and how it reads as code

What the sources look like

These are real endpoints I inspected:

  • Notice CSV: https://notice.go.jp/docs/status_notice.csv
  • Ministry CSV roster: https://www.soumu.go.jp/main_content/000323625.csv
  • Environment sample CSV: https://www.env.go.jp/content/900398071.csv
  • Cabinet Office guidance on data use (PDF): https://www.cas.go.jp/jp/seisaku/digital_gyozaikaikaku/data8/data8_siryou1.pdf
  • Digital Agency "Data for AI" note: https://digital-gov.note.jp/n/neb45f4883f23

These show a mix: some machine-ready CSVs, many KPI reports embedded as PDFs (see Cabinet Office, local evaluations like Tsukuba or Yamaguchi PDFs), and web pages describing grant rules (chisou.go.jp).

Technical issues observed

  • Format heterogeneity: CSV files use differing encodings, column names in Japanese/English, date formats (YYYY/MM/DD vs. Japanese era), and inconsistent delimiters. That makes automated joins a nightmare.
  • Metadata absence: Many datasets lack schema declarations (types, units), provenance, or explicit licenses. 要するに、you can't trust or reuse without manual inspection.
  • PDF-embedded KPIs: Many performance sheets are PDFs (e.g., R6 evaluation sheets). PDFs kill automation — you need OCR or brittle parsing.
  • No unified API or OpenAPI spec: There's no single programmatic entry point that provides KPIs, grant allocations, and realized outcomes together.

Example: measuring KPI gap (quick code)

This is a minimal Python sketch to load a CSV KPI sheet and compute target-vs-actual gaps. Code write-up helps developers reproduce audits.

import pandas as pd

load a sample CSV published by a prefecture

kpi = pd.read_csv('https://www.soumu.go.jp/main_content/000323625.csv', encoding='utf-8')

normalize column names

kpi.columns = kpi.columns.str.strip().str.lower()

assume columns: 'kpi_name','target','actual'

kpi['target'] = pd.to_numeric(kpi['target'], errors='coerce')

kpi['actual'] = pd.to_numeric(kpi['actual'], errors='coerce')

kpi['gap_pct'] = (kpi['actual'] - kpi['target'])/kpi['target']*100

print(kpi[['kpi_name','target','actual','gap_pct']].sort_values('gap_pct'))

Engineer note: real datasets need cleaning: Japanese numerals, commas, missing units. Use a data pipeline (Airflow) with schema checks (Great Expectations) and automated alerts.

Policy analysis: grants vs. outcomes

Looking at Digital Den'en Toshi grant docs (chisou.go.jp) and municipal evaluation PDFs (Tsukuba, Yamaguchi), a pattern emerges: projects set KPIs but reporting formats differ year-to-year. That makes longitudinal evaluation hard. If KPI = contract, then contracts must be machine-verifiable. Right now they're only human-verifiable PDFs.

Concrete engineering proposals

  • Publish a central Open Data API (e.g., /api/v1/grants, /api/v1/kpis) with OpenAPI docs and JSON-LD responses.
  • Standardize KPI schema (id, project_id, kpi_type, unit, baseline, target, actual, measured_at, source_url, license).
  • Require machine-readable submission for grant reporting (CSV/JSON), not only PDFs. Provide CSV templates and validator scripts.
  • Implement CI for data: run daily validators (encoding, schema, nulls) and expose dataset health dashboards.
  • Provide canonical example notebooks and an npm / PyPI package for common transformations (jp-date parsing, yen normalization).

まとめ

This isn't rocket science — Japan already publishes useful datasets. But treating policy like code means: define schemas, enforce machine-readable reporting, version data, and provide APIs. That unlocks civic tech, reproducible audits, and faster iteration of public programs.

おかむーから一言

I keep saying: tech is a multiplier — give us clean APIs and we’ll build the watchdogs and helpers. Let’s make government data act like source code: versioned, tested, discoverable. Ready when you are! 🚀