Oireachtas API Python SDK
Welcome to the official documentation for the Houses of the Oireachtas Open Data API - Python SDK.
This library is a modern, lightweight Python client SDK for querying open parliament data from the national parliament of Ireland (Houses of the Oireachtas).
๐ 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).
- High Performance: Optimized request headers and error handling mechanisms.
๐ Installation
Installing via PyPI
You can install the package directly from PyPI:
Installing from GitHub
To install the latest development version directly from GitHub:
๐ก 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.
๐ Data Models Reference
See the sidebar/navigation tabs for details of all data models returned by the API.
๐ฌ Contact & Support
- Official API Portal: beta.oireachtas.ie/en/open-data
- Email: open.data@oireachtas.ie
- License: Oireachtas (Open Data) PSI Licence