psephology

Query UK Parliamentary election results via SQL in PostgreSQL.

1|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/danbri/forgetmenot --skill psephology
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: psephology
Source: https://github.com/danbri/forgetmenot/tree/main/skills/psephology
Command: npx skills add https://github.com/danbri/forgetmenot --skill psephology

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pg_ctlcluster, psql, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill provides a structured, relational database of UK Parliamentary election results, solving the difficulty of accessing and cross-referencing historical election data, candidate performance, and constituency boundary changes.

Core Features & Use Cases

  • Relational Election Data: Access detailed records on candidacies, vote counts, shares, and majorities from 2010 to the present.
  • Boundary Change Analysis: Track constituency history and boundary set legislation across different general elections.
  • Use Case: Use this skill to perform complex SQL analysis on election outcomes, such as identifying the largest majorities in a specific general election or mapping candidate performance to specific political parties.

Quick Start

Use the psephology skill to list all tables and their row counts to verify the current database state.

Frequently Asked Questions about psephology

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query UK Parliamentary election results using SQL?

To query UK Parliamentary election results using SQL, you use a local PostgreSQL environment to execute queries against provided election data dumps. The relational database interface supports complex analytical queries across general elections and by-elections from 2010 onwards.

What data is available for analyzing UK elections and constituency boundaries?

The available data for analyzing UK elections includes detailed records on candidacies, vote counts, shares, majorities, and constituency boundaries. You can track constituency history and boundary set legislation across general elections from 2010 to the present.

Do I need PostgreSQL to analyze UK election data dumps?

Yes, you need PostgreSQL to analyze the UK election data dumps. The skill requires a local PostgreSQL environment and depends on pg_ctlcluster and psql to execute SQL queries against the structured election data.

Can I track constituency boundary changes across different general elections?

Yes, you can track constituency boundary changes across different general elections. The relational election data includes constituency history and boundary set legislation, allowing you to cross-reference historical election data and boundary changes from 2010 onwards.

How do I verify the database state when starting UK election data analysis?

To verify the database state when starting UK election data analysis, use the skill to list all tables and their row counts. This quick start approach confirms the current state of the election data dumps loaded in your PostgreSQL environment.

What are the limitations of using SQL for psephology and election analysis?

Limitations of using SQL for psephology include the requirement for a local PostgreSQL environment and dependency on command-line tools like psql. The dataset is also limited to UK Parliamentary elections from 2010 onwards, excluding earlier historical data.