Skip to content

donjguido/Akomo-Notso-Quebec

Repository files navigation

LexQC — Quebec Charter as open, structured data

LexQC makes the Charte des droits et libertés de la personne (RLRQ c C-12) available as a machine-readable, standards-compliant artifact: full Akoma Ntoso XML, FRBR URIs, a cross-reference graph, and an amendment timeline, served as a static site.

LexQC landing page

What this is (and isn't)

Is

  • A reproducible pipeline that ingests the consolidated Charter from LégisQuébec and emits:
    • Akoma Ntoso 3.0 XML (validated against the official schema),
    • a JSON projection of the same structure,
    • a static HTML site with per-article pages, FRBR URIs, a cross-reference graph, and an amendment timeline.
  • MIT-licensed code; CC BY 4.0 data outputs.

Isn't (MVP scope is deliberately narrow)

  • One act only: the Charter (C-12).
  • One language: French.
  • One deliverable: a static site on GitHub Pages.
  • No hosted database, no public API, no bilingual output, no other acts, no regulations.

Everything beyond that is explicitly deferred — see TODO.md if present in the working tree.

How to access it

  • Browse the site — once published, the latest build is available at the GitHub Pages URL for this repository (https://donjguido.github.io/Akomo-Notso-Quebec/). The site is rebuilt automatically on every push to main via .github/workflows/deploy.yml.
  • Download the data — the site/ artifact produced by the build contains the Akoma Ntoso XML and the derived JSON alongside the HTML.
  • Run it yourself — see Local development below.

Article view with FRBR URI and amendment history

Licenses

  • Code — MIT. See LICENSE.
  • AKN output and derived JSON — Creative Commons Attribution 4.0 International (CC BY 4.0). See LICENSE-DATA.

When you reuse the data, credit both this project and its source: Éditeur officiel du Québec — LégisQuébec. See ATTRIBUTION.md for full attribution guidance and the status of the LégisQuébec terms-of-use review.

Source

The underlying legislative text comes from LégisQuébec, the official consolidated legislation service operated by the Éditeur officiel du Québec. LexQC is independent and unofficial; LégisQuébec remains the authoritative source.

Local development

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
pytest

To build the static site locally:

python scripts/build_site.py --output site

Running the ingestion pipeline with Docker

The API and worker services are legacy to the static-site MVP but remain useful for end-to-end ingestion runs against a local Postgres.

copy .env.example .env
# edit .env and set POSTGRES_PASSWORD plus the matching LEXQC_*_URL values
docker compose up --build

Never commit .env. Only .env.example is tracked.

Design notes

  • Akoma Ntoso XML is the source of truth. JSON and HTML are derived views.
  • FRBR URIs are used throughout (e.g. /akn/ca-qc/act/1975/c-12/fra@2023-06-01/!main/art_10).
  • Amendments create new expressions; nothing is deleted.
  • Attribution to Éditeur officiel du Québec is emitted in AKN <FRBRSource> and in an X-Source-Attribution HTTP header on served responses.

Modules

See src/lexqc/:

  • frbr.py — FRBR URI helpers (wraps cobalt)
  • ingestion/fetcher.py — rate-limited, cached HTTP fetcher
  • ingestion/parser.py — HTML → AKN XML
  • ingestion/refs.py — cross-reference extractor
  • ingestion/validator.py — schema validation
  • ingestion/loader.py — transactional loader
  • api/app.py — FastAPI routes (legacy; static site is the MVP target)
  • cli.pylexqc ingest charter, lexqc validate

About

Quebec Charter of Human Rights and Freedoms (RLRQ c C-12) as open, structured data — Akoma Ntoso 3.0 XML, FRBR URIs, cross-references, amendment timeline, served as a static site.

Topics

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-DATA

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages