Skip to content
Back to skills

Elections Nz

ASecurity

Query official New Zealand election results, electorate voting, turnout, aggregate party political finance and reporting rules from the Electoral Commission.

  • 31 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
businesspythongobash

Works with

  • cli

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add thecolab-ai/.skills --skill elections-nz --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Elections Nz?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Elections Nz
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/thecolab-ai-elections-nz/badge)](https://www.skillsdirectory.com/skills/thecolab-ai-elections-nz)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: elections-nz
description: "Query official New Zealand election results, electorate voting, turnout, aggregate party political finance and reporting rules from the Electoral Commission."
license: MIT
compatibility: "Requires Python 3.10+ and network access for live data"
metadata:
  thecolab.category: "government"
  thecolab.source_owner: "Electoral Commission"
  thecolab.source_type: "official"
  thecolab.auth: "none"
  thecolab.access_mode: "public-download"
  thecolab.data_class: "public"
  thecolab.writes: "false"
  thecolab.browser: "false"
  thecolab.risk: "low"
  thecolab.cache_ttl: "24h"
  thecolab.schema_version: "1"
  thecolab.skill_type: "public-download"
  thecolab.pack: "nz-public-data"
  thecolab.source_url: "https://elections.nz/stats-and-research/"
  thecolab.allowed_domains: "elections.nz,www.elections.nz,electionresults.govt.nz,www.electionresults.govt.nz"
  thecolab.last_verified: "2026-09-12"
  thecolab.health: "healthy"
  thecolab.maintainer: "@adam91holt"
---

# Elections NZ

Use the read-only Python CLI to retrieve and filter records exposed by the official first-party source.
Every command supports `--json`, bounded requests, stable exit codes, source URLs and retrieval timestamps.

## Commands

```bash
# discover election results
python3 scripts/cli.py results --year VALUE --json
# discover electorate results
python3 scripts/cli.py electorate NAME --year VALUE --json
# discover party-vote results
python3 scripts/cli.py party-vote --year VALUE --json
# discover turnout series
python3 scripts/cli.py turnout --year VALUE --json
# discover candidate results
python3 scripts/cli.py candidate NAME --year VALUE --json
# discover party donation returns
python3 scripts/cli.py donations --party VALUE --json
# discover candidate expense returns
python3 scripts/cli.py expenses --candidate VALUE --json
# query Commission-published annual donation/loan aggregates (optional party filter)
python3 scripts/cli.py finance-aggregates [PARTY] --kind annual --year 2025 --json
# query Commission-published election-expense aggregates
python3 scripts/cli.py finance-aggregates [PARTY] --kind expenses --year 2023 --json
# retrieve exact source-wording rules (optional topic filter)
python3 scripts/cli.py finance-rules [TOPIC] --kind annual --year 2025 --json
```

Add `--limit N` (1–100) to bound any command. Human output is the default.

## Coverage and interpretation

- Only Electoral Commission outcomes are authoritative.
- Preserve preliminary versus official status and publication date.
- Finance aggregates retain reporting period, metric and missing-value context. Donation, loan, expense, expense-limit and broadcasting metrics remain distinct.
- Reporting rules preserve source wording and mentioned amounts. Unknown effective dates stay unknown; this output is not legal advice.
- Finance aggregation uses only the Commission's published party-summary tables. It never extracts donor/contributor names, addresses or donor-level records, and never recomputes totals from detailed schedules.
- Do not derive voter-level profiles or political persuasion.

Result commands parse the Commission's published CSV tables. Existing `donations` and `expenses` commands continue to return matching first-party return documents. `finance-aggregates` returns structured party-summary facts; `finance-rules` returns scoped official wording. A valid unmatched filter is an empty success, while source-layout or amount drift fails explicitly.

## Resources

- `scripts/cli.py` — canonical command entrypoint
- `scripts/test_contract.py` — deterministic repository contract audit
- `scripts/test_finance.py` — aggregate-only, adversarial and CLI-state tests
- `scripts/smoke_test.py` — parser fixture and bounded live probe
- `tests/fixtures/overall-results.csv`, `turnout.csv`, `winning-candidates.csv`, `finance.html`, `finance-annual.html` and `finance-expenses.html` — scrubbed export-specific fixtures
- `references/source-notes.md` — feasibility, provenance and source limits

Files in this skill

  • SKILL.md2.8 KB
  • references/source-notes.md1.4 KB
  • scripts/cli.py6.2 KB
  • scripts/election_results.py6.4 KB
  • scripts/smoke_test.py2.1 KB
  • scripts/test_contract.py376 B
  • tests/fixtures/contract.json172 B
  • tests/fixtures/finance.html295 B
  • tests/fixtures/overall-results.csv344 B
  • tests/fixtures/turnout.csv436 B
  • tests/fixtures/winning-candidates.csv258 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.