gazette-translated-indexed (Gazette Trail) tells you what an Indian gazette notification amends, what amended it before, and what superseded it, which you cannot see by reading one notification alone. It is a SQLite citation graph built from quoted primary-source text.
Open-Source Tools · How-To · Govt data & research ops
How to use gazette-translated-indexed: a citation index of Indian gazette notifications
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/gazette-translated-indexed
Watch the walkthrough
Watch on YouTube: youtu.be/wJMHJzOV_UM
Why it is useful
- Who benefits: trade, tax and compliance researchers, legal-data builders and journalists who must trace a notification through its amendment chain.
- What it replaces: manually hunting for 'in the notification number X, dated Y' references across separate PDFs on egazette.gov.in.
- Evidence from the run: the seed SQL files rebuilt a database of 2,637 notifications and 2,150 cross-references across 53 ministries, with an empty foreign-key check.
- Evidence from the run: the repo's own test suite passed (197 tests, 0.3 seconds) and one Customs notification (45/2025) showed 9 incoming links, including 2 corrigenda.
What it is for
Gazette Trail is a citation index. Each notification is a row; each 'amends', 'supersedes', 'corrigendum', 'rescinds', 'repeals' or 'cites' link is a row in a cross_reference table. Reading the links in both directions gives you the lineage of a rule: what it changed and what changed it later.
The links are drawn from real quoted notification text, recurring sentence shapes are matched by shared regex templates, and each ministry module has its own tests. The pilot is CBIC customs notifications, extended to 53 central ministries.
This demo used only the committed SQL seed files and ran no live fetch. Nothing was downloaded from egazette.gov.in, and no PDFs or OCR were used.
Who it is for
- Researchers and compliance teams tracing amendments to Indian rules
- Developers building legal or regulatory knowledge graphs
- Data journalists who need an amendment chain for a notification
- Legal advice. This is an index of public notifications, not a legal opinion; read the official notification before acting.
- A complete or up-to-date record. Coverage is bounded and the repo says new notifications must be checked with its freshness script.
- Reading the full legal text. The database stores citations and summaries, not the PDFs.
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3 and a virtual environment | to run the tests and the CRUD helpers | python3 -m venv .venv |
| pymupdf, requests, pytest | listed in requirements.txt (pymupdf is only needed for PDF extraction) | pip install -r requirements.txt |
| sqlite3 command line | to load the schema and seed files | preinstalled on macOS and most Linux |
| Network access (optional) | only to fetch PDFs by gazette ID from egazette.gov.in, not needed for this demo | none |
Get the code and an AI assistant
You do not have to be a programmer. Get the repository, give it to an AI assistant, and ask in plain language. Any of these routes works:
| Tool | What you need | Best for |
|---|---|---|
| GitHub | Free account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in Codespaces | Getting the code and keeping up with updates |
| Claude Code | Claude subscription or API key; run claude inside the cloned folder | Letting the AI read and run the whole repo |
| Gemini CLI | Google account; run gemini inside the cloned folder | The same hands-on workflow with Gemini |
| Claude.ai, Gemini or ChatGPT in the browser | A chat account; upload README.md and the files you care about (or paste the output of git ls-files) | Understanding the project and asking questions without installing anything |
| Other tools (Copilot Chat, Cursor, Codex CLI) | Open the cloned folder in the tool and point it at README.md first | Editing and extending the code |
git clone https://github.com/herrrickshaw/gazette-translated-indexed.git
cd gazette-translated-indexed
claude # or: gemini
Install
- Clone the repo and create a virtual environment.
git clone https://github.com/herrrickshaw/gazette-translated-indexed.git cd gazette-translated-indexed python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt
Quick start: commands and what you should see
Build the database from the seed files.
sqlite3 gazette.db < db/schema.sql
for f in db/seed_*.sql; do sqlite3 gazette.db < "$f"; done
sqlite3 gazette.db "PRAGMA foreign_key_check;"
The foreign-key check prints nothing, which is the pass condition.
Run the test suite.
pytest tests/
In the 19 October 2026 run: 197 passed in 0.30s (the README still says 141 tests, so its counts lag).
Read one notification's lineage.
python3 -c "
import sqlite3
from db.crud import get_lineage
c=sqlite3.connect('gazette.db'); c.execute('PRAGMA foreign_keys = ON')
print(get_lineage(c,'power-so-5852-2022'))"
A dictionary with 'points_at' and 'pointed_at_by'; here one later power-ministry notification amends it.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
Relation types across the whole index
sqlite3 -header -column gazette.db "select relation_type, count(*) n from cross_reference group by 1 order by n desc;"
relation_type n
------------- ----
amends 1655
cites 213
supersedes 155
corrigendum 90
rescinds 32
repeals 5
Amendments dominate; supersession and corrigenda are the minority.
Everything that points at Customs notification 45/2025
sqlite3 -header -column gazette.db "select g.gazette_id, g.publish_date, g.gsr_or_so, x.relation_type from cross_reference x join gazette_notification g on g.gazette_id=x.source_gazette_id where x.target_gazette_id='cus-45-2025';"
gazette_id publish_date gsr_or_so relation_type
------------------ ------------ ------------- -------------
cus-2-2026 2026-02-01 G.S.R. 83(E) amends
cus-corr-45-2025-a 2025-10-31 G.S.R. 807(E) corrigendum
cus-48-2025 2025-11-14 G.S.R. 847(E) amends
cus-6-2026 2026-03-12 G.S.R. 181(E) amends
cus-14-2026 2026-04-30 G.S.R. 330(E) amends
cus-15-2026 2026-05-12 G.S.R. 358(E) amends
cus-corr-45-2025-b 2026-06-12 G.S.R. 476(E) corrigendum
cus-25-2026 2026-07-08 G.S.R. 600(E) amends
cus-44-2025 2025-10-24 G.S.R. 782(E) cites
Nine later or related notifications link to one 2025 customs notification: the amendment chain a single PDF does not show.
Most-amended targets
sqlite3 -header -column gazette.db "select target_gazette_id, count(*) n from cross_reference group by 1 order by n desc limit 3;"
target_gazette_id n
------------------ --
dopt-gsr-730-1986 26
dopt-gsr-152-1954 23
dopt-gsr-610-1985 15
Personnel (DoPT) rules from the 1950s to 1980s are the most-amended targets.
Ways to use it
| Method | How it works |
|---|---|
| SQLite directly | Query gazette_notification and cross_reference with any SQLite client. |
| db/crud.py | list_notifications and get_lineage are the supported read path; deletes are soft by default. |
| LLM corpus export | python3 -m render.llm_export --db gazette.db writes a JSONL with one notification per line and one-hop lineage. |
| Via an AI assistant | Point an assistant at README.md and the database and ask it to trace a notification. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Read README.md and explain the Gazette Trail pipeline from fetching a PDF to a cross-reference row, in a short table.
- Using gazette.db, list every notification that amends or supersedes cus-45-2025 in date order and explain each relation.
- Write a read-only SQLite query that finds notifications with no incoming or outgoing cross-references and explain what that might mean.
- Which ministries have the most cross-references, and what does the repo's MINISTRY_COVERAGE_PLAN say about the three abandoned ones?
- Explain how the five shared extraction templates in extract/common_templates.py differ, with one example sentence each.
- Check the README totals against the built database and list the numbers that have drifted.
Limits and honest caveats
- Citation index of public notifications, not legal advice. Verify against the official egazette.gov.in notification.
- README counts lag the data: it says 2,591 notifications, 2,113 cross-references and 141 tests; the 19 October 2026 build gave 2,637, 2,150 and 197.
- Coverage is bounded: 53 ministries are modelled, 3 are documented as abandoned, and new notifications need the freshness check.
- The demo did not fetch any PDFs, run OCR or translation, and did not use the optional Colab notebooks (not run).
- The built-in page renderer (render.pages) was not run in this demo.
Sources: Repo README, SQL seed files and tests in github.com/herrrickshaw/gazette-translated-indexed; commands and counts captured in a throwaway virtual environment on 19 October 2026. The database was built in a scratch folder and nothing was committed.
- v1.0.0 — 20 October 2026 — first published.
About this article: Researched, written and edited by Umashankar Triplicane Dwarakanathan, with AI research assistance; every figure is meant to trace to the primary source cited. See the Editorial Policy for how sourcing, AI use and corrections work.