Legalize Spain: Open Data for Spanish Laws
Imagine a world where Spain’s entire legal framework lives in a Git repository. Every law is a Markdown file, every reform a commit, and the entire legislative history accessible with a few commands. That’s the vision behind Legalize Spain—a groundbreaking open-data project that turns Spanish legislation into a version-controlled, searchable, and collaborative resource.
How Legalize Spain Works
Legalize Spain transforms over 8,600 laws from the Spanish State Gazette (BOE) into a structured Git repository. Each law is stored as a Markdown file with metadata like publication date, status, and source. Reforms are tracked as commits, preserving the complete history of changes since 1960. This system lets users explore laws, track amendments, and compare versions using familiar Git tools.
Key Features
- Version Control for Laws: Every reform is a commit with an official publication date and source link.
- Searchable Repository: Find articles like the 2011 Budget Stability Reform with
greporgit log. - Structured Metadata: YAML frontmatter includes law titles, identifiers, and status (e.g., “vigente”).
- Open Source: The project uses MIT-licensed tools, while law content remains in the public domain.
Accessing Legalize Spain
Getting started is simple. Clone the repository and explore laws directly from your terminal:
git clone https://github.com/EnriqueLop/legalize-es.git
For example, to check the current text of Article 135 of the Spanish Constitution:
grep -A 10 "Artículo 135" spain/BOE-A-1978-31229.md
To see when it was last modified:
git log --oneline -- spain/BOE-A-1978-31229.md
File Structure
The repository organizes laws by identifier:
spain/
├── BOE-A-1978-31229.md
# Spanish Constitution
├── BOE-A-1995-25444.md
# Criminal Code
├── BOE-A-2015-11430.md
# Workers’ Statute
└── ... (8,600+ laws)
Why This Matters
Legalize Spain isn’t just a technical novelty—it’s a tool for transparency. By leveraging Git’s version control, it solves a critical problem: tracking legislative changes over time. Legal professionals, researchers, and developers can now:
- Compare law versions side-by-side using
git diff. - Automate updates with APIs (coming soon via legalize.dev).
- Contribute corrections by reporting issues in the GitHub repo.
Contributing to Legalize Spain
The project thrives on community input. If you spot an error or missing reform, open an issue with the law’s name, article number, and official source. The project’s creator, Enrique Lopez, emphasizes collaboration: “This isn’t my work—it’s a collective effort to make law accessible.”
Future of Legalize Spain
Plans include an API for programmatic access, advanced search filters, and real-time notifications for law updates. For now, the GitHub repository is the best way to explore this innovative approach to legal data.
Conclusion
Legalize Spain reimagines how we interact with legislation. By combining open data, version control, and public domain content, it empowers users to explore, analyze, and contribute to Spain’s legal framework. Whether you’re a developer, legal expert, or curious citizen, this project offers a fresh perspective on transparency and accessibility.
Ready to explore? Visit the GitHub repository or follow updates at legalize.dev.







