Spanish legislation as a Git repo

Project overview & data quality

  • Repo maps Spanish state legislation to markdown files with git history; 8,600+ laws and ~28,000 commits.
  • Commits use historical publication dates, but ordering is imperfect:
    • Some commits appear out of chronological order.
    • One commit has a 2099 date; pre-1970 dates are also problematic due to Unix timestamp limits.
  • BOE consolidated legislation is incomplete; not all laws are covered.
  • Parsing misses some tables and images from source documents.
  • OP later shares the multi-country pipeline (Spain + France) and invites contributors for other jurisdictions.

Perceived value and use cases

  • Major benefit: replacing “amend paragraph X” text with real diffs, enabling:
    • Quick view of all reforms to a law.
    • Exact before/after comparisons.
    • Easier tracking of evolution and complexity of legislation.
  • Suggested applications:
    • Legal research tools, visualization of law evolution, graph databases of cross-references.
    • Compliance / legaltech APIs.
    • Citizen-facing tools and first-pass legal advisors.
    • Academic or civic analysis of legislative activity.

Comparisons to other systems

  • Several countries already have some form of versioned law:
    • France (Legifrance, visual diffs, Catala DSL).
    • UK, Germany, Argentina, Sweden, Netherlands, Brazil, etc. via various official or civic projects.
  • Many jurisdictions still rely on scattered PDFs or proprietary databases; some private entities claim copyright over consolidated texts.

Law, courts, and jurisdictional nuance

  • Multiple comments stress that statutes alone are insufficient in common-law systems; case law and court rulings are essential.
  • In civil-law systems (e.g., Spain, Sweden), precedents are officially non-binding but influential in practice.
  • Spain also has autonomous community regulations and local “ordenanzas”; these are often published in separate gazettes and not covered here.

Feature ideas and “software-thinking”

  • Proposed enhancements:
    • Commit authors reflecting legislatures or parties, plus metadata on votes.
    • “PRs” for reforms with discussion logs.
    • Semantic structure in markdown for better navigation.
    • CI-like checks for contradictions and “unit tests” for legal edge cases and loopholes.
  • Some see these as powerful and overdue; others criticize them as “software engineer-brained,” arguing law is inherently interpretive and context-dependent.

Business, openness, and politics

  • Some see strong startup potential in curated, structured legal data; others note incumbents already sell such services with heavy manual work.
  • Comments highlight barriers:
    • Lack of open data for court decisions in Spain.
    • Perceived incentives for lawyers, publishers, and legislators to keep law complex and opaque.
  • Nonprofits and civic projects are experimenting with making git the canonical legal record by partnering directly with governments.