Second Reading is a web app that aims to make it easier for the public to understand what goes on during Singapore's Parliament sittings. It aggregates data from the Hansard, which contains the official reports of parliamentary debates, and organises the data from each session into a more user-friendly format.
NOTE: Second Reading only contains data for sittings from the 13th Parliament onwards (January 2016 - present).
The official Hansard reports are text-only and rather difficult to read. Thus, each sitting's report is broken down into sections, organised by content type, and properly paginated where necessary, allowing the user to view the proceedings in a more digestible manner.
Broadly speaking, each sitting has three categories of content: questions, bills, and (other) motions. These are each collated into their own respective pages, and users can search through them.
Each question, bill, and motion is tagged to their respective speakers. MPs have their own individual page which lists which of these they have spoken on. Users can then use the MP's page to find out more about their involvement in Parliament.
Each question, bill, and motion is usually associated with a particular ministry. Thus, where possible, each piece of content is tagged to the ministry. This serves as a proxy for the topic of discussion, and users can thus use each ministry's page to find parliamentary discussions that are related to that ministry and/or topic.
These are provided for:
- Each section of a sitting
- Each MP's contributions in Parliament (based on their last 20 involvements)
Second Reading is written in Astro and uses SQLite for its database. For more details, please refer to the astro/ directory. The summaries are generated using Gemini 3 Flash.
Data is fetched from the Hansard API, processed, and then inserted into the database using the Python scripts found in the python/ directory. For more details, please refer to the README.md there.
Note that the script only works for Hansard data for sittings from ~2012 onwards, as earlier sittings have their data stored in a different format. Additionally, after ingesting the data, we performed several manual modifications to our database to correct some errors in the Hansard API.
If you wish to replicate Second Reading independently, you can follow the steps below.
-
Clone the repository
git clone https://github.com/isaacyclai/second-reading.git cd second-reading -
Install frontend dependencies
cd astro bun install -
Install Python dependencies
We use
uvto manage dependencies.cd python uv sync -
Setup database
Then, run the following script from the
python/directory. Dates should be inDD-MM-YYYYformat.uv run batch_process_sqlite.py <start_date> <end_date>
-
(Optional) Generate summaries
Add your Gemini API key in the
.envfile:GEMINI_API_KEY=your_gemini_api_key
To generate summaries for sessions and members, run the following.
uv run generate_summaries_sqlite.py --sittings <start_date> <end_date> uv run generate_summaries_sqlite.py --members
-
Run Development Server
From the
astro/directory:bun run build bun run dev
Open http://localhost:4321 to view the app.
This project is inspired by the creators of Telescope and Pair Search.
The copyright to the Hansard is owned by the Singapore Government.