Code-Telling Manifesto: How Japan's Public Data Stacks Up (and How to Fix It)

IT Policy Proposals
Code-Telling Manifesto: How Japan's Public Data Stacks Up (and How to Fix It)

どうも〜おかむーです! Today I'm digging into how Japanese government and local open data behave from an engineering standpoint — the "Code-Telling Manifesto" take. エンジニア的に言うと、政策はコードとデータでも語るべきなんですよね。

  • Government publishes lots of CSVs and PDFs, but formats and encodings vary a lot
  • Machine-readability rules are being set (CAS/Digital Agency), yet catalogs and APIs remain inconsistent
  • Practical fixes: UTF-8/CSV canonicalization, OpenAPI, DCAT metadata, CI for data quality — here's how

結論

Public-sector data is moving in the right direction (policy documents on machine readability exist), but the current ecosystem is a patchwork: inconsistent encodings, mixed CSV/PDF publishing, and sparse APIs make automation fragile. 要するに、技術的な標準化とデベロッパー向け UX を優先すれば、政策の透明性と二次利用がぐっと上がります。

Report: what I checked and what it shows

What I looked at (examples from official sources)

  • notice.go.jp/status_notice.csv — an example CSV endpoint served directly (good!)
  • digital.go.jp resource CSVs (survey answers, hospital list) — real open files but encoding/garbage can appear
  • env.go.jp CSV (Ibaraki) and Tokyo's open data catalog — visible catalogs and datasets
  • Policy docs: cas.go.jp PDFs and Digital Agency materials on machine readability and AI-Ready goals

これ見てくださいよ:official CSV links exist, but some files contain mojibake/encodings (see digital.go.jp CSV snippet) or inconsistent column names. That makes automated pipelines brittle.

Technical problems I observed

  • Encoding variety: many files are Shift_JIS/CP932 or have BOMs. For automation, UTF-8 should be the default.
  • Schema drift: same concept (e.g., hospital lists) uses different column sets and naming conventions across jurisdictions.
  • PDFs vs CSVs: some statistics are published as PDFs (or CSVs embedded in PDFs), which hinders parsing.
  • Lack of machine-readable metadata: catalogs exist (Tokyo, prefectures), but not all expose DCAT or JSON-LD metadata consistently.
  • API gaps: raw CSV links are helpful, but a lot of datasets lack a stable REST/GraphQL API with pagination, schema discovery, and formats.

Concrete code sketches (how I'd ingest these reliably)

import pandas as pd

url = 'https://notice.go.jp/docs/status_notice.csv'

robust read: try utf-8 then fallback to cp932

for enc in ['utf-8','cp932','shift_jis']:

try:

df = pd.read_csv(url, encoding=enc)

break

except Exception:

continue

normalize columns

df.columns = df.columns.str.strip().str.lower().str.replace(' ', '_')

要するに、エンジニアならこのフォールバックと正規化は常套手段ってことです。

Policy vs reality

Government materials (CAS/Digital Agency) set goals toward "machine-readable" administrative data and AI-Ready timelines. That's great — but operationally, municipal publishing cycles, legacy systems, and Excel-first workflows mean adoption is uneven. Numbers are there, but accessibility and trustworthiness for automated use lag.

Practical improvement plan (engineering-first)

  • Canonical formats: mandate UTF-8 CSV/JSON as primary downloadable forms; PDFs as secondary.
  • Schema registry: publish a central schema (JSON Schema / OpenAPI) per dataset type (hospitals, vehicles, notices).
  • Metadata: DCAT + schema.org dataset descriptions with license, version, lastUpdated, sample rows.
  • CI and validation: each dataset gets a Git-backed pipeline (pre-commit + GitHub Actions) to validate encoding, column types, and sample counts.
  • Simple API layer: stabilize endpoints with OpenAPI, CORS enabled, rate limits and caching. Provide example client snippets (curl, Python, JS).
  • Publisher tooling: lightweight CLI to convert Excel -> canonical CSV/JSON-LD and auto-register metadata.
  • Benefits: downstream apps, journalists, and researchers stop writing brittle scrapers and can build reproducible analyses.

    まとめ

    • Japan has the raw ingredients: catalogs, CSV links, and policy momentum
    • The missing piece is developer ergonomics: consistent encodings, schemas, and APIs
    • A modest engineering push (schemas + CI + OpenAPI + metadata) delivers outsized gains for transparency and reuse

    おかむーから一言

    I'm a founder and full-stack dev — tech scales transparency. Small changes (UTF-8, a schema, a CI test) unlock huge social value. Let's make public data truly programmable!