Map real 2024 line items into the proposed categories and write down the rules.
The job. Take real 2024 line items and map them into the proposed categories. Write down the rule you used each time. The rules matter more than the coverage.
| Source | Electoral Commission, party campaign spending, 2024 general election |
| Rows | 27,281 line items |
| Value | £68,600,029 |
| Fields | 21, including supplier name, supplier ID, date incurred, and a four-nation amount split |
| Current categories | 10, set in 2000 |

Two categories carry two thirds of the money. "Unsolicited material to electors" is £26.0m and "Advertising" is £20.3m. Most of the interesting mapping decisions sit inside those two.
| Current category | Line items | Total |
|---|---|---|
| Unsolicited material to electors | 4,394 | £25,967,739 |
| Advertising | 3,682 | £20,276,000 |
| Market research/canvassing | 1,014 | £7,055,579 |
| Overheads and general administration | 6,868 | £6,264,244 |
| Transport | 9,828 | £2,898,279 |
| Rallies and other events | 921 | £2,377,727 |
| Media | 242 | £2,329,950 |
| Campaign broadcasts | 185 | £1,163,362 |
| Party manifesto or third party material | 146 | £267,057 |
| Transport (outside s.75) | 1 | £90 |
Note the shape of it. Transport has 9,828 line items worth £2.9m, so a mean of £295. Advertising has 3,682 items worth £20.3m. Any rule you write has to cope with both.
Supplier name is the only real evidence. The category field tells you what the party chose. The supplier name often tells you what was actually bought. When they disagree, the supplier name is usually closer to the truth.
Invoices exist but are redacted. Entries above £200 have an invoice attached. They add detail and they are images, so anything systematic needs the structured fields.
Some items straddle two categories. A direct mail campaign designed by an agency and printed by a printer could be campaign material, campaign advice, or both. This is one of the questions the Commission has asked itself and has not answered.
ec_2024_party_spending.csv is the full extract, all 27,281 rowscurrent_categories.csv is the table abovesample_line_items.csv is the forty largest items, to read before startingmapping_worksheet.csv is a blank worksheet: current category, proposed category, rule used, confidence, notesproposed_categories.txt is the nine categories we have written downA worksheet with rules in it, and an honest confidence column. Half the rows mapped with defensible rules beats all of them mapped by guessing.
What you produce attaches inferred categories to real party and supplier names. It stays in the room. The published Commission data underneath it is public and carries no restriction.