Skip to content

Repository files navigation

Legalize

Legislation as code. Every law as a Markdown file. Every reform as a Git commit.

Legalize turns official legislation into version-controlled, machine-readable data. Browse, search, diff, and build on structured legal data from 31 countries.

legalize.dev — Browse laws, see diffs, search across legislation.

Countries

Country Repo Laws Source Status
🇵🇹 Portugal legalize-pt 109,411 DRE ✅ Live
🇮🇹 Italy legalize-it 86,518 Normattiva ✅ Live
🇨🇴 Colombia legalize-co 71,900 SUIN-Juriscol ✅ Live
🇺🇸 United States legalize-us 59,765 OLRC ✅ Live
🇩🇰 Denmark legalize-dk 45,400 Retsinformation ✅ Live
🇵🇱 Poland legalize-pl 34,115 Sejm ELI ✅ Live
🇦🇷 Argentina legalize-ar 30,500 InfoLEG ✅ Live
🇦🇹 Austria legalize-at 21,832 RIS ✅ Live
🇳🇱 Netherlands legalize-nl 20,416 BWB ✅ Live
🇱🇺 Luxembourg legalize-lu 19,724 Legilux ✅ Live
🇨🇿 Czech Republic legalize-cz 18,340 e-Sbírka ✅ Live
🇧🇪 Belgium legalize-be 17,742 Justel ✅ Live
🇪🇺 European Union legalize-eu 15,784 EUR-Lex ✅ Live
🇱🇻 Latvia legalize-lv 15,088 likumi.lv ✅ Live
🇱🇹 Lithuania legalize-lt 14,945 TAR ✅ Live
🇪🇸 Spain legalize-es 12,241 BOE ✅ Live
🇺🇾 Uruguay legalize-uy 10,155 IMPO ✅ Live
🇸🇪 Sweden legalize-se 8,942 Riksdagen ✅ Live
🇬🇷 Greece legalize-gr 6,803 ΕΤ ✅ Live
🇨🇱 Chile legalize-cl 6,401 BCN ✅ Live
🇨🇴 Colombia legalize-co ~4k SUIN-Juriscol 🚧 WIP
🇨🇭 Switzerland legalize-ch 5,789 Fedlex ✅ Live
🇩🇪 Germany legalize-de 5,729 GII ✅ Live
🇮🇪 Ireland legalize-ie 4,021 ISB ✅ Live
🇫🇮 Finland legalize-fi 4,007 Finlex ✅ Live
🇬🇧 United Kingdom legalize-uk 3,970 legislation.gov.uk ✅ Live
🇦🇩 Andorra legalize-ad 3,545 BOPA ✅ Live
🇱🇮 Liechtenstein legalize-li 3,504 LiLex ✅ Live
🇪🇪 Estonia legalize-ee 1,597 Riigi Teataja ✅ Live
🇳🇴 Norway legalize-no 779 Lovdata ✅ Live
🇸🇰 Slovakia legalize-sk 300 Slov-Lex ✅ Live
🇫🇷 France legalize-fr 83 codes Légifrance ✅ Live
🇰🇷 South Korea legalize-kr 5,575 law.go.kr ✅ Community
🇺🇦 Ukraine legalize-ua — Rada 🚧 Pipeline ready
🇧🇷 Brazil — — LeXML 🔜 Help wanted

Want to add your country? See the step-by-step guide.

How it works

Each law is a Markdown file with YAML frontmatter. When a reform is published, the file is updated and committed with the official publication date.

Standard Git tools become legal research tools:

# Clone Spanish legislation
git clone https://github.com/legalize-dev/legalize-es.git

# What does Article 135 of the Constitution say today?
grep -A 10 "Artículo 135" es/BOE-A-1978-31229.md

# When did it change?
git log --oneline -- es/BOE-A-1978-31229.md

# Show the exact diff of the 2011 fiscal stability reform
git diff 6660bcf^..6660bcf -- es/BOE-A-1978-31229.md

Ask an assistant

Claude, ChatGPT, Cursor and anything else that speaks MCP can read this corpus directly: add https://legalize.dev/mcp as a connector. Read-only tools, free tier, sign-in required.

The one worth having is law_at_date — what a norm said on a given day, with the commit SHA behind the answer, so the quote is checkable against these repos rather than taken on trust. There are also diffs between two dates and the amendment history of any law.

Details and setup for each client: legalize-dev/mcp · listed in the official MCP Registry as dev.legalize/legalize.

Repos

Repo What
legalize This repo. Index, docs, overview.
legalize-pipeline The engine. Fetches, parses, and commits legislation for 30+ countries.
legalize-sdks Official client libraries for the Legalize API — Python, Node/TypeScript, Go, curl.
mcp The official MCP connector — endpoint, tools, and how to wire it into an AI client.
legalize-pt Portuguese laws (109,411 norms).
legalize-it Italian laws (86,518 norms).
legalize-co Colombian laws (71,900 norms).
legalize-us United States Code (59,765 sections).
legalize-dk Danish laws (45,400 norms).
legalize-pl Polish laws (34,115 acts).
legalize-ar Argentine laws (30,500 norms).
legalize-at Austrian laws (21,832 norms).
legalize-nl Dutch laws (20,416 norms).
legalize-lu Luxembourgish laws (19,724 norms).
legalize-cz Czech laws (18,340 norms).
legalize-be Belgian laws (17,742 norms).
legalize-eu EU legislation (15,784 acts).
legalize-lv Latvian laws (15,088 norms).
legalize-lt Lithuanian laws (14,945 norms).
legalize-es Spanish laws (12,241 norms + 17 autonomous communities).
legalize-uy Uruguayan laws (10,155 norms).
legalize-se Swedish statutes (8,942 laws).
legalize-gr Greek laws (6,803 ΦΕΚ).
legalize-cl Chilean laws (6,401 norms).
legalize-ch Swiss federal laws (5,789 norms).
legalize-de German laws (5,729 laws).
legalize-ie Irish laws (4,021 acts).
legalize-fi Finnish laws (4,007 norms).
legalize-uk UK legislation (3,970 acts).
legalize-ad Andorran laws (3,545 norms).
legalize-li Liechtenstein laws (3,504 norms).
legalize-ee Estonian laws (1,597 norms).
legalize-no Norwegian laws (779 norms).
legalize-sk Slovak laws (300 norms).
legalize-fr French codes (83 codes).
legalize-kr South Korean laws (5,575 laws). Community contribution by @9bow.

Why

Legal texts are amended constantly, but tracking changes is hard. Official sources publish consolidated versions with no way to compare. Commercial providers charge hundreds per month for version history.

Legalize is open legal infrastructure:

  • For developers — structured, versioned legal data with a REST API
  • For researchers and journalists — explore the evolution of legislation with git
  • For citizens — see how the laws that affect you have changed

Contributing

The main contribution is adding a new country. Read the format spec for the minimal contract, then follow the step-by-step guide. check_spec.py in this repo is a small, dependency-light (just PyYAML) conformance checker, and the reference implementation of §Directory layout's resolve() rule. python3 check_spec.py <path-to-a-country-repo> reads the spec version that repo declares, checks every law file and every commit against the clauses that version defines, and exits non-zero on a violation — seconds on a corpus of a few hundred thousand commits, with no network and no clone. python3 check_spec.py --list prints the rules it implements, the section of the spec each one comes from, and the shell command to ask the same question by hand.

You can use the shared legalize-pipeline or build your own pipeline — as long as the output follows the spec. South Korea was built with an independent pipeline and it works great.

Found an error in a law text? Open an issue in the relevant country repo with the law name, article, and the official source showing the correct version.

Support

Legalize is open source and free. If you want to help fund hosting and development:

License

Legislative content: public domain (sourced from official government publications). Repository structure, metadata, and tooling: MIT.


Created by Enrique Lopez · legalize.dev

About

Legislation as code. Every law as a Markdown file. Every reform as a Git commit.

Resources

Code of conduct

Security policy

Stars

289 stars

Watchers

6 watching

Forks

Releases

Packages

Contributors

Languages