Legalize ES — Spanish Legislation Git Repository
Skill by ara.so — Daily 2026 Skills collection.
What It Is
legalize-es is a Git repository containing 8,600+ Spanish laws as Markdown files, with every legislative reform recorded as a Git commit. Each law is a single .md file named by its BOE identifier (e.g. BOE-A-1978-31229.md for the Spanish Constitution). Reform history goes back to 1960.
Key capabilities:
- Full text search across all laws with
grep - Exact diff between any two versions of a law using
git diff - Timeline of all reforms to a specific law using
git log - Historical state of any law at any point in time using
git show/git checkout
Setup
All law files live in the spain/ directory.
File Structure
YAML Frontmatter
Every file starts with structured metadata:
rango values:
constitucionley-organicaleyreal-decreto-leyreal-decreto-legislativo
estado values:
vigente— currently in forcederogado— repealed
Key Commands
Find a Law by Topic
Read a Specific Article
Find a Law by Its BOE Identifier
Filter by Law Type
Git History Commands
See All Reforms to a Law
Diff Between Two Versions
Read Historical Version of a Law
Find When a Specific Text Was Added or Removed
Programmatic Access Patterns
Shell Script: Extract All Law Titles
Shell Script: Find Laws Updated After a Date
Python: Parse Law Frontmatter
Python: Get Reform History via Git
Python: Compare Two Versions of a Law
Python: Search Across All Laws
Common Workflows
Workflow 1: Research a Legal Topic
Workflow 2: Track a Specific Reform
Workflow 3: Export Laws to JSON
Troubleshooting
Repo is Too Large to Clone
Git Log Shows No History After Shallow Clone
Encoding Issues on Windows
Finding a Law Without Its BOE ID
Data Source & License
- Legislative content: Public domain — sourced from BOE Open Data API
- Repository structure, metadata, tooling: MIT License
- Official source per law: See
fuente:field in each file's frontmatter - Part of: Legalize multi-country project
- Upcoming: Programmatic API at legalize.dev

