lexifina/global-law
DataBrowse many countries' laws as one dated git history, querying what text was in force on any day.
Global-law arranges national legal corpora as git submodules and interleaves them into one timeline, so a commit represents the state of all covered jurisdictions on one day. It suits lawyers, researchers and developers who need to ask what a provision said on a specific date, which law changed it, and how text evolved — without manually reconciling official gazettes.
What it does and how it works
Each country's law lives in its own lexifina/<country>-law repository; every commit there is one law taking effect. This repository pins those repositories and replays their commits in in-force-date order, naming the corpus, corpus commit, law and in-force date in the commit trailers. The first commit is a lawless jurisdiction tree dated 1 January 1970; the last adds the README, tools and tests. Builds are deterministic, so a rebuilt corpus leads to a from-scratch rebuild and force-push here — after which submodule initialization and a forced tag fetch are needed inside the affected corpus (README).
Coverage is uneven and explicitly labelled. Some corpora hold a country's whole statute book (Czechia, Spain, Switzerland, Georgia, Malta); others hold a few acts or a sample — the US corpus is nine titles of the United States Code, the UK corpus only special educational needs law. manifest.json records each corpus's coverage and how its history is known: dated official versions (in-force), reconstruction by applying amending acts (replayed, with checked dates named), or today's text only (current-only). Laws adopted but not yet in force stay on each corpus's future branch and are absent from main.
Two ways to query it
- Command line:
tools/law.pyoffers world snapshots, showing a provision on a date, line or word attribution, diffs, and lists of laws over date ranges. Dates must beYYYY-MM-DD; out-of-range queries report the limit on stderr (README). - MCP for AI clients:
tools/mcp_server.pyis a stdio Model Context Protocol server for Claude, Cursor and similar clients. It needs Python 3.10+ and git, runs locally, reads the repository, makes no network calls and changes nothing, and exposes 18 read-only tools covering provision lookup, dated readings, word-level authorship, change impact, citations and precedent (README).
Concrete limits
- A missing file on a date may mean the provision was not yet in force or that the corpus does not reach back that far.
- Retroactive law is recorded in commit messages but does not alter the text shown for earlier dates.
git blamecredits whole lines;law.py wordscompares versions to credit individual words.- Git cannot store pre-1970 dates, so old changes carry 1970 commit dates one second apart; the
In-forcetrailer is authoritative and the tools use it, while plaingit log --beforecan silently give wrong answers. - To inspect an older moment, use a separate worktree; checking out an old commit in place loses folders and the tools.
Licensing
This repository's own content is CC0 — fork and build on it without permission or credit. The law text remains in each country's repository under that repository's own terms, so downstream reuse must respect per-corpus licensing (README, license).
HotRepo's take
The project was listed at 793 total stars, #26, on the all-languages NEW-REPOSITORY board on 2026-10-30, which is not a daily growth measure. Comparable daily-board history is insufficient; the only Hacker News thread found is a 1-point, 1-comment post on 2026-10-29 (thread).
Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.