Code-First Manifest: Evaluating Japan's Public Data Stack from an Engineer's Lens

IT Policy Proposals
Code-First Manifest: Evaluating Japan's Public Data Stack from an Engineer's Lens

どうも〜おかむーです! Today we're doing a tech-forward read of Japan's public data landscape — think of it as a manifesto told in code and CSVs. エンジニア的に言うと、政策の信頼性はデータの可読性とパイプラインの堅牢さで半分決まるんですよ。

  • e-Stat and Japan Dashboard centralize lots of official stats, but formats vary and APIs are uneven.
  • Many agencies publish CSVs (or Shift-JIS CSVs!) and PDFs — machine-readability is still inconsistent.
  • With practical fixes (UTF-8, OpenAPI + Parquet buckets + DCAT metadata), reuse and oversight would skyrocket.

結論

Japan has the right ingredients — e-Stat (https://www.e-stat.go.jp/), Japan Dashboard via the Digital Agency, ministry CSV dumps (e.g. MHLW caregiving CSVs) and the corporate-number bulk downloads (https://www.houjin-bangou.nta.go.jp/) — but the stack needs standardization: consistent encodings (UTF-8), well-documented APIs (OpenAPI), machine-readable KPIs (not just PDFs), and modern bulk formats (Parquet/ndjson) for scale.

Report

What I looked at

  • e-Stat portal & dashboard (https://www.e-stat.go.jp/, https://dashboard.e-stat.go.jp/) — great central index and visualizations; they also provide APIs, but usage patterns and metadata can be improved.
  • Corporate number bulk CSVs (https://www.houjin-bangou.nta.go.jp/download/zenken/index.html) — downloadable in Shift-JIS/Unicode and XML. Practical, but legacy encodings cause friction.
  • MHLW caregiving open data (https://www.mhlw.go.jp/stf/kaigo-kouhyou_opendata.html) — large CSVs by service type, which is awesome for reuse.
  • Japan Dashboard effort (Digital Agency) — promising centralization and leadership.
  • Example of grant reporting as PDF (prefecture PDF) — KPIs exist but locked in paginated PDFs.

Technical pain points (これ見てくださいよ)

  • Encoding hell: Shift-JIS CSVs are common (corporate-number dataset). That forces every consumer to handle encodings explicitly. 要するに、UTF-8なら余計なバグが減るということです。
  • Fragmented formats: CSV, Shift-JIS CSV, XML, PDF — no unified metadata (DCAT) or schema registry.
  • API variability: some sources expose APIs (e-Stat), others only bulk files. No consistent discoverability (no OpenAPI hub).
  • Scale & performance: massive CSVs (tens of MBs+) require chunked processing. For analytics, Parquet on object storage would be better.
  • Auditability: policy targets (KPI) published in PDFs (e.g. grant reports) make programmatic tracking hard.

Practical code snippets

Here’s a small Python pattern to robustly fetch and normalize a Shift-JIS CSV (corporate number example) into Parquet for analytics:

import requests, io

import pandas as pd

r = requests.get('https://www.houjin-bangou.nta.go.jp/.../zenken.csv', stream=True)

detect Shift-JIS, read in chunks

with io.BytesIO(r.content) as b:

df = pd.read_csv(b, encoding='shift_jis')

df.to_parquet('houjin.parquet')

For API-first data (e-Stat), prefer parameterized calls and caching headers. Example curl pattern:

curl "https://api.e-stat.go.jp/rest/2.1/app/json/getStatsData?appId=YOUR_KEY&statsDataId=0000020201" -o data.json

Recommendations (engineer-friendly roadmap)

  • Mandate UTF-8 for all new CSV/JSON/XML endpoints; provide legacy-encoding flags for transition.
  • Publish OpenAPI specs for every API and a central OpenAPI gateway (Digital Agency can host).
  • Provide DCAT-compliant metadata catalog (dataset-level): update cadence, schema, primary keys.
  • Bulk+Streaming: provide Parquet dumps on object storage (S3-like) for bulk analytics plus paginated JSON/REST for lightweight apps.
  • Machine-readable KPIs: when budgets/grants (e.g. デジタル田園都市国家構想交付金) publish results, include CSV/JSON KPI timeseries alongside PDFs.
  • Offer starter SDKs and reproducible notebooks showing how to join corporate numbers with ministry datasets (sample code, schema mappings).

まとめ

Japan's public data ecosystem has strong foundations — centralized portals, generous CSV dumps, and an emerging dashboard strategy. エンジニア的には、次は「standardize and serve」フェーズ:UTF-8, OpenAPI, DCAT, Parquet. These moves make oversight, civic tech innovation, and evidence-based policy much easier.

おかむーから一言

I’ve built startups and shipped public-data tools — the tech is simple, the coordination is the hard part. Push for standards, publish the KPIs as data, and we'll build much better democracy tooling together!