Skip to content

Irishsmurf/OireachtasAPI

Repository files navigation

oireachtas-api

The Houses of the Oireachtas is providing these APIs to allow our datasets to be retrieved and reused as widely as possible. They are intended to be used in conjunction with https://data.oireachtas.ie, from where our datasets can be accessed directly. By using the APIs, users can make metadata queries to identify the specific data they require. New data are available through the API as soon as they are published. Currently, https://data.oireachtas.ie contains data in XML format from the Official Report of the Houses of the Oireachtas (the "debates") and replies to Parliamentary Questions in XML files complying with the Akoma Ntoso schema, as well data in PDF format for Bills, Acts and other documents published by the Houses of the Oireachtas. Files can be retrieved from https://data.oireachtas.ie by adding the URI fragment contained in the "formats" fields of the JSON documents returned by these APIs. At the moment only PDF and XML files are available directly from https://data.oireachtas.ie, but this will become the endpoint for direct access of all "uri" fields in the data queried through https://api.oireachtas.ie. We will also be making bulk downloads available through https://data.oireachtas.ie. Please note the APIs are a work in progress. We are working on expanding the range of datasets we publish, and we are interested in hearing about how to make these APIs more useful and wide ranging. For these reasons, we welcome any feedback, suggestions and user stories to [email protected] Data published through these APIs are made available under the Oireachtas (Open Data) PSI Licence

This Python package is automatically generated by the Swagger Codegen project:

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

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

(you may need to run pip with root permission: sudo pip install git+https://github.com/Irishsmurf/OireachtasAPI.git)

Then import the package:

import oireachtas_api 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import oireachtas_api

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import oireachtas_api
from oireachtas_api.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = oireachtas_api.ConstituenciesApi(oireachtas_api.ApiClient(configuration))
chamber_id = ['[]'] # list[str] | Filter by house or committee uri. Example  /ie/oireachtas/house/dail/32  (optional) (default to [])
chamber = '' # str | Filter by House name (dail or seanad). Using an empty string retrieves results for both Houses.  (optional) (default to )
house_no = 56 # int | filter by house number (optional)
skip = 0 # int | This is a base filter which is used on many APIs, allowing skipping of records by a specific integer. (optional) (default to 0)
limit = 50 # int | This is a base filter which is used on many APIs, allowing the limiting of records to a specific integer. (optional) (default to 50)

try:
    # Constituencies List
    api_response = api_instance.constituencies(chamber_id=chamber_id, chamber=chamber, house_no=house_no, skip=skip, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConstituenciesApi->constituencies: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.oireachtas.ie/v1

Class Method HTTP request Description
ConstituenciesApi constituencies GET /constituencies Constituencies List
DebatesApi debates GET /debates Debates List
DivisionsApi divisions GET /divisions Divisions
FiltersApi members GET /members Members
HousesApi houses GET /houses Houses
LegislationApi legislation GET /legislation Legislation API
MembersApi members GET /members Members
PartiesApi parties GET /parties Parties List
QuestionsApi questions GET /questions Questions Filtered by Type Only

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

[email protected]

About

Python Library for interacting with the Oireachtas API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published