Skip to content

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 pytest with 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:

pip install oireachtas-api

Installing from GitHub

To install the latest development version directly from GitHub:

pip install git+https://github.com/Irishsmurf/OireachtasAPI.git

๐Ÿ’ก 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