Skip to content
jonobriPublic

About

🍞 Read the Australian Hansard without an API key. Every parliament, colonial times to today.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

hansel 🍞

Read the Australian Hansard without an API key. Every parliament, colonial times to today.

Australia has nine parliaments, each with its own Hansard website, format, search syntax and URL scheme. hansel knows which site holds which era for each one, how to list sitting days, download a day’s debates and search them, and how to cite what you find. A small command-line tool wraps the routes so an agent can fetch a day’s Hansard in one call.

What it does

  • Routes every parliament by era. It covers the Commonwealth, NSW, Victoria, Queensland, South Australia, Western Australia, Tasmania, the Northern Territory and the ACT. For each one it gives the site, the years held, and the format (born-digital text, XML, or a scanned volume with an OCR layer).
  • Lists sitting days, fetches a day’s Hansard, and searches, through scripts/hansel.py:
    • plain Python, standard library only;
    • it uses shuck, a headless browser, for the sites behind a JavaScript challenge.
  • Handles each site’s quirks for you. For example, ParlInfo serves a missing file as an ordinary page, and South Australia’s search defaults to the last year. The script works around these, and each reference file explains them.
  • Reads scans safely. Most pre-1990s Hansard is a scanned volume whose hidden OCR layer swaps digits and mangles names. The skill has you check the page image before quoting.
  • Gives the citation form for each parliament: series, volume, page, date and chamber. It also says where the printed page number sits, since it is rarely the PDF page index.
  • Says what to use when there is no Hansard. It points to Trove newspaper reports (via trover), Votes and Proceedings, and library print holdings, and says how to cite each as what it is.

Coverage

Parliament Online Hansard Script: days / fetch / search Needs shuck
Commonwealth (Reps, Senate) 1901–present ✓ / ✓ / ✓ no
New South Wales (LA, LC) Official 1879–present; Sydney Morning Herald scans 1856–79 ✓ / ✓ / ✓ (keyword search 1991–) search only
Victoria (LA, LC) 1851–present ✓ / ✓ / ✓ (keyword search 1991–) no
Queensland (LA; LC to 1922) 1860–present ✓ / ✓ / ✓ no
South Australia (HA, LC) 1857–58, then 1946–present ✓ / ✓ / ✓ yes
Western Australia (LC, LA) 1870–present ✓ / ✓ / ✓ yes
Tasmania (HA, LC) 1979–present (official Hansard began in 1979) ✓ / ✓ (2023–) / ✓ (keyword search 1979–) no
Northern Territory (LA) 1974–present ✓ / ✓ / ✓ no
ACT (LA) 1989–present ✓ / ✓ / ✓ search only

Install

git clone https://github.com/jonobri/hansel.git ~/Code/hansel
ln -s ~/Code/hansel/skills/hansel ~/.claude/skills/hansel

You need:

  • Python 3.9+;
  • shuck on your PATH, for South Australia, Western Australia, and the NSW and ACT keyword searches;
  • pdftotext and pdftoppm (poppler), for reading what you fetch.
python3 ~/.claude/skills/hansel/scripts/hansel.py days nsw 1965
python3 ~/.claude/skills/hansel/scripts/hansel.py fetch cth 1925-06-10 --format xml
python3 ~/.claude/skills/hansel/scripts/hansel.py search qld 'granny flat' --from 1977 --to 1977

Limitations

  • Tasmania, 1979–2022. This is held only on search.parliament.tas.gov.au. That host is sometimes unavailable, and when it is, only the days captured by the Wayback Machine can be reached. The script lists and fetches days from 2023 onwards and searches 1979 onwards; a day from 1979–2022 is opened from its search result. That index has few or no Legislative Council files for 1993–2002 and none for 2018 to early 2021, so a zero there means “not indexed”, not “not said”.

  • Keyword search in scanned eras. Where a parliament never indexed its OCR text (NSW 1879–1991, Victoria before 1991), there is no keyword search. You list the sitting days, download them and search the text yourself.

  • Eras with no Hansard at all:

    • South Australia 1858–1945;
    • Tasmania before 1979;
    • the NT Legislative Council (1948–74);
    • the ACT’s bodies before 1989.

    For these the skill points to newspaper reports and formal records instead, and asks you to cite them as press reports, not Hansard.

  • Recent days start as proofs. Most parliaments publish an uncorrected proof first and replace it later. The skill shows how to tell which version you have.

Licence

hansel itself is MIT-licensed. Hansard belongs to each parliament, and the terms differ:

  • Commonwealth: CC BY-NC-ND.
  • Northern Territory: CC BY 4.0.
  • Queensland: Hansard is excluded from the state’s open licence, so fair dealing only.
  • NSW, SA and WA: attributed, fair and accurate extracts are allowed, but not use for advertising or satire.
  • Victoria: personal, non-commercial and research use is permitted.

Check the relevant terms, summarised in each reference/<jur>.md, before redistributing anything you retrieve.

About

🍞 Read the Australian Hansard without an API key. Every parliament, colonial times to today.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages