A Python utility to scrape Canadian parliamentary bills and laws from the LEGISinfo API and document viewer, converting updates into Git commits in a separate data repository.
You can run legisinfo-scraper as a command-line tool directly:
To run the scraper without installing it locally:
uvx --from git+https://github.com/mlhamel/legisinfo-scraper.git legisinfo-scraper --repo /path/to/legisinfo.git --session 45-1uv tool install git+https://github.com/mlhamel/legisinfo-scraper.gituv tool install legisinfo-scraperOnce installed, the CLI tool legisinfo-scraper will be available directly:
legisinfo-scraper --repo /path/to/legisinfo.git --session 45-1To scrape all historical legislative data across all sessions:
legisinfo-scraper --repo /path/to/legisinfo.git --session all- Downloads the active session bills list in XML format.
- Identifies all bills and crawls their detailed status and publications.
- Downloads the bill metadata XML and legislative text drafts.
- Updates the target directory.
- Performs git diff analysis and commits updates with detailed messages.