Houses of the Oireachtas Open Data API - Python SDK
A modern, lightweight Python client SDK for retrieving and querying open parliament data from the national parliament of Ireland (Houses of the Oireachtas).
📖 Full Documentation: The comprehensive interactive documentation built with MkDocs is available on GitHub Pages: https://irishsmurf.github.io/OireachtasAPI/
This client SDK makes metadata queries easy, allowing you to discover and locate specific official documents, bills, members, votes (divisions), and debates. Output formats point directly to XML/PDF datasets hosted at data.oireachtas.ie.
🚀 Key Features
- Modern Python 3 Support: Fully compatible with Python 3.8+ (legacy Python 2 support has been dropped).
- Fully Tested: Upgraded to use
pytestwith a complete suite of unit (mocked) and integration (live API) tests. - Open Access: Works out of the box with the public Oireachtas API endpoints (no authentication tokens required).
- Automated CI/CD: GitHub Actions verify compatibility on every push and automatically build & publish new GitHub Releases when tags are created.
🛠 Installation
Installing via PyPI
You can install the package directly from PyPI:
pip install oireachtas-api
Installing directly from GitHub
To install the latest development version directly from GitHub:
pip install git+https://github.com/Irishsmurf/OireachtasAPI.git
Local Development Setup
To clone the repository and install it in editable mode with development dependencies:
# Clone the repository
git clone https://github.com/Irishsmurf/OireachtasAPI.git
cd OireachtasAPI
# Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install requirements
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt -r test-requirements.txt
pip install -e .
💡 Quick Start Example
This code demonstrates how to retrieve the 5 most recent active Constituencies:
import oireachtas_api
from pprint import pprint
# 1. Initialize the simplified client
client = oireachtas_api.Client()
try:
# 2. Query constituencies (returns standard Python list/dict)
response = client.constituencies(limit=5)
# 3. Print the API response
print("--- Oireachtas Constituencies ---")
pprint(response)
except oireachtas_api.ApiException as e:
print(f"Failed to query constituencies: {e}")
📂 Core API Reference
All requests call the live API endpoint: https://api.oireachtas.ie/v1.
Simplified Unified Client
The Client class consolidates all endpoints into a single wrapper. Method calls return standard Python dictionaries and lists, eliminating the need to interact with verbose auto-generated model objects:
import oireachtas_api
client = oireachtas_api.Client()
# Retrieve constituencies
constituencies = client.constituencies(limit=5)
# Access member information
members = client.members(limit=10)
| Method API | Description / Use Case | Official Specs |
|---|---|---|
constituencies() |
Retrieve electoral districts | Docs |
debates() |
Access official debates transcripts | Docs |
divisions() |
Inspect parliamentary votes and counts | Docs |
houses() |
Query house info (Dáil or Seanad) | Docs |
legislation() |
Query active & historic bills and acts | Docs |
members() |
Look up details of TDs and Senators | Docs |
parties() |
List political parties | Docs |
questions() |
Query parliamentary questions (PQs) | Docs |
Note: The legacy individual service API classes (ConstituenciesApi, MembersApi, etc.) and data models are still exported for backward compatibility.
🧪 Testing Guide
We use pytest for unit and integration tests.
1. Isolated Unit Tests (Mocked Network)
To run local test stubs using mock API responses (extremely fast, offline-safe):
pytest -m "not integration"
2. Live Integration Tests
To verify compatibility against the real, live Oireachtas API endpoints:
pytest -m "integration"
3. Run the Whole Test Suite
To run all tests:
pytest
🏷 Release Automation
This project tracks official releases automatically:
- Ensure your version code is up to date in setup.py.
- Commit your changes and tag the master branch:
git tag v2.0.0 git push origin v2.0.0
- The Release Workflow will automatically build the package wheels, publish a GitHub Release with build assets attached, and publish the release to PyPI using OIDC Trusted Publishing.
📬 Contact & Support
- Official API Portal: beta.oireachtas.ie/en/open-data
- Email: open.data@oireachtas.ie
Metadata
Release files for oireachtas-api 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oireachtas_api-2.1.0.tar.gz | 55.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oireachtas_api-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 300.1 kB
Release files / oireachtas_api-2.1.0.tar.gz
| Download URL | oireachtas_api-2.1.0.tar.gz |
|---|---|
| Size | 55.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7aa3eb05d36088a15887b592dbbdf6909dfa435ee7c8dbdde5677fdfd28d3af
|
|
BLAKE2b-256 checksum How to use checksums |
3a9a87497df7dc9b8509dbca6a35e07a7443e177e5ed0e13fa81d0024d2d1831
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.
Transparency logRelease files / oireachtas_api-2.1.0-py3-none-any.whl
| Download URL | oireachtas_api-2.1.0-py3-none-any.whl |
|---|---|
| Size | 245.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1af1c988f3eb20688a32e0871e139960cbaea72e0ce941ae9f291d46c9f23602
|
|
BLAKE2b-256 checksum How to use checksums |
a31acec1eb1d909126b4d75b23472d60179e20b1f531eaec46054b0e89e8ca51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 20, 2026.
Transparency log