oireachtas-api 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. oireachtas_api-2.0.0/PKG-INFO +30 -0
  2. oireachtas_api-2.0.0/README.md +132 -0
  3. oireachtas_api-2.0.0/oireachtas_api/__init__.py +84 -0
  4. oireachtas_api-2.0.0/oireachtas_api/api/__init__.py +13 -0
  5. oireachtas_api-2.0.0/oireachtas_api/api/constituencies_api.py +144 -0
  6. oireachtas_api-2.0.0/oireachtas_api/api/debates_api.py +160 -0
  7. oireachtas_api-2.0.0/oireachtas_api/api/divisions_api.py +175 -0
  8. oireachtas_api-2.0.0/oireachtas_api/api/filters_api.py +172 -0
  9. oireachtas_api-2.0.0/oireachtas_api/api/houses_api.py +140 -0
  10. oireachtas_api-2.0.0/oireachtas_api/api/legislation_api.py +194 -0
  11. oireachtas_api-2.0.0/oireachtas_api/api/members_api.py +172 -0
  12. oireachtas_api-2.0.0/oireachtas_api/api/parties_api.py +144 -0
  13. oireachtas_api-2.0.0/oireachtas_api/api/questions_api.py +162 -0
  14. oireachtas_api-2.0.0/oireachtas_api/api_client.py +642 -0
  15. oireachtas_api-2.0.0/oireachtas_api/configuration.py +243 -0
  16. oireachtas_api-2.0.0/oireachtas_api/models/__init__.py +69 -0
  17. oireachtas_api-2.0.0/oireachtas_api/models/error_response.py +112 -0
  18. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200.py +138 -0
  19. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001.py +138 -0
  20. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001_question.py +305 -0
  21. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001_question_by.py +160 -0
  22. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001_question_debate_section.py +184 -0
  23. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001_question_debate_section_formats.py +136 -0
  24. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001_question_to.py +184 -0
  25. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2001_results.py +112 -0
  26. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002.py +138 -0
  27. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record.py +280 -0
  28. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_chamber.py +136 -0
  29. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_counts.py +208 -0
  30. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_debate_section.py +356 -0
  31. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_debate_section_counts.py +136 -0
  32. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_debate_section_speakers.py +112 -0
  33. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_debate_sections.py +112 -0
  34. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_debate_record_house.py +232 -0
  35. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2002_results.py +112 -0
  36. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003.py +138 -0
  37. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003_division.py +400 -0
  38. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003_division_debate.py +184 -0
  39. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003_division_house.py +232 -0
  40. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003_division_subject.py +136 -0
  41. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003_division_tallies.py +161 -0
  42. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2003_results.py +113 -0
  43. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004.py +138 -0
  44. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_head.py +163 -0
  45. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_head_counts.py +138 -0
  46. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_head_date_range.py +138 -0
  47. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member.py +363 -0
  48. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership.py +238 -0
  49. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_house.py +213 -0
  50. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_office.py +138 -0
  51. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_office_date_range.py +138 -0
  52. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_office_office_name.py +113 -0
  53. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_offices.py +113 -0
  54. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_parties.py +113 -0
  55. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_party.py +188 -0
  56. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_party_date_range.py +113 -0
  57. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_represent.py +188 -0
  58. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_membership_represents.py +113 -0
  59. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_member_memberships.py +113 -0
  60. oireachtas_api-2.0.0/oireachtas_api/models/inline_response2004_results.py +113 -0
  61. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_bill.py +616 -0
  62. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_bill_amendment_lists.py +113 -0
  63. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_bill_origin_house.py +136 -0
  64. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_bill_stages.py +112 -0
  65. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_bill_version.py +233 -0
  66. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_bill_versions.py +112 -0
  67. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_head.py +163 -0
  68. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_head_date_range.py +138 -0
  69. oireachtas_api-2.0.0/oireachtas_api/models/inline_response200_results.py +112 -0
  70. oireachtas_api-2.0.0/oireachtas_api/rest.py +320 -0
  71. oireachtas_api-2.0.0/oireachtas_api.egg-info/PKG-INFO +30 -0
  72. oireachtas_api-2.0.0/oireachtas_api.egg-info/SOURCES.txt +138 -0
  73. oireachtas_api-2.0.0/oireachtas_api.egg-info/dependency_links.txt +1 -0
  74. oireachtas_api-2.0.0/oireachtas_api.egg-info/requires.txt +3 -0
  75. oireachtas_api-2.0.0/oireachtas_api.egg-info/top_level.txt +2 -0
  76. oireachtas_api-2.0.0/setup.cfg +4 -0
  77. oireachtas_api-2.0.0/setup.py +56 -0
  78. oireachtas_api-2.0.0/test/__init__.py +0 -0
  79. oireachtas_api-2.0.0/test/test_constituencies_api.py +49 -0
  80. oireachtas_api-2.0.0/test/test_debates_api.py +50 -0
  81. oireachtas_api-2.0.0/test/test_divisions_api.py +40 -0
  82. oireachtas_api-2.0.0/test/test_error_response.py +39 -0
  83. oireachtas_api-2.0.0/test/test_filters_api.py +40 -0
  84. oireachtas_api-2.0.0/test/test_houses_api.py +50 -0
  85. oireachtas_api-2.0.0/test/test_inline_response200.py +39 -0
  86. oireachtas_api-2.0.0/test/test_inline_response2001.py +39 -0
  87. oireachtas_api-2.0.0/test/test_inline_response2001_question.py +39 -0
  88. oireachtas_api-2.0.0/test/test_inline_response2001_question_by.py +39 -0
  89. oireachtas_api-2.0.0/test/test_inline_response2001_question_debate_section.py +39 -0
  90. oireachtas_api-2.0.0/test/test_inline_response2001_question_debate_section_formats.py +39 -0
  91. oireachtas_api-2.0.0/test/test_inline_response2001_question_to.py +39 -0
  92. oireachtas_api-2.0.0/test/test_inline_response2001_results.py +39 -0
  93. oireachtas_api-2.0.0/test/test_inline_response2002.py +39 -0
  94. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record.py +39 -0
  95. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_chamber.py +39 -0
  96. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_counts.py +39 -0
  97. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_debate_section.py +39 -0
  98. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_debate_section_counts.py +39 -0
  99. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_debate_section_speakers.py +39 -0
  100. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_debate_sections.py +39 -0
  101. oireachtas_api-2.0.0/test/test_inline_response2002_debate_record_house.py +39 -0
  102. oireachtas_api-2.0.0/test/test_inline_response2002_results.py +39 -0
  103. oireachtas_api-2.0.0/test/test_inline_response2003.py +39 -0
  104. oireachtas_api-2.0.0/test/test_inline_response2003_division.py +39 -0
  105. oireachtas_api-2.0.0/test/test_inline_response2003_division_debate.py +39 -0
  106. oireachtas_api-2.0.0/test/test_inline_response2003_division_house.py +39 -0
  107. oireachtas_api-2.0.0/test/test_inline_response2003_division_subject.py +39 -0
  108. oireachtas_api-2.0.0/test/test_inline_response2003_division_tallies.py +39 -0
  109. oireachtas_api-2.0.0/test/test_inline_response2003_results.py +39 -0
  110. oireachtas_api-2.0.0/test/test_inline_response2004.py +39 -0
  111. oireachtas_api-2.0.0/test/test_inline_response2004_head.py +39 -0
  112. oireachtas_api-2.0.0/test/test_inline_response2004_head_counts.py +39 -0
  113. oireachtas_api-2.0.0/test/test_inline_response2004_head_date_range.py +39 -0
  114. oireachtas_api-2.0.0/test/test_inline_response2004_member.py +39 -0
  115. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership.py +39 -0
  116. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_house.py +39 -0
  117. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_office.py +39 -0
  118. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_office_date_range.py +39 -0
  119. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_office_office_name.py +39 -0
  120. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_offices.py +39 -0
  121. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_parties.py +39 -0
  122. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_party.py +39 -0
  123. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_party_date_range.py +39 -0
  124. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_represent.py +39 -0
  125. oireachtas_api-2.0.0/test/test_inline_response2004_member_membership_represents.py +39 -0
  126. oireachtas_api-2.0.0/test/test_inline_response2004_member_memberships.py +39 -0
  127. oireachtas_api-2.0.0/test/test_inline_response2004_results.py +39 -0
  128. oireachtas_api-2.0.0/test/test_inline_response200_bill.py +39 -0
  129. oireachtas_api-2.0.0/test/test_inline_response200_bill_amendment_lists.py +39 -0
  130. oireachtas_api-2.0.0/test/test_inline_response200_bill_origin_house.py +39 -0
  131. oireachtas_api-2.0.0/test/test_inline_response200_bill_stages.py +39 -0
  132. oireachtas_api-2.0.0/test/test_inline_response200_bill_version.py +39 -0
  133. oireachtas_api-2.0.0/test/test_inline_response200_bill_versions.py +39 -0
  134. oireachtas_api-2.0.0/test/test_inline_response200_head.py +39 -0
  135. oireachtas_api-2.0.0/test/test_inline_response200_head_date_range.py +39 -0
  136. oireachtas_api-2.0.0/test/test_inline_response200_results.py +39 -0
  137. oireachtas_api-2.0.0/test/test_legislation_api.py +40 -0
  138. oireachtas_api-2.0.0/test/test_members_api.py +50 -0
  139. oireachtas_api-2.0.0/test/test_parties_api.py +40 -0
  140. oireachtas_api-2.0.0/test/test_questions_api.py +40 -0
@@ -0,0 +1,30 @@
1
+ Metadata-Version: 2.4
2
+ Name: oireachtas-api
3
+ Version: 2.0.0
4
+ Summary: Houses of the Oireachtas Open Data APIs Python SDK
5
+ Home-page: https://github.com/Irishsmurf/OireachtasAPI
6
+ Author-email: open.data@oireachtas.ie
7
+ Keywords: Oireachtas,Ireland,Parliament,API,Open Data
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.8
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Requires-Python: >=3.8
17
+ Requires-Dist: certifi>=2020.6.20
18
+ Requires-Dist: python-dateutil>=2.8.2
19
+ Requires-Dist: urllib3>=2.0.0
20
+ Dynamic: author-email
21
+ Dynamic: classifier
22
+ Dynamic: description
23
+ Dynamic: home-page
24
+ Dynamic: keywords
25
+ Dynamic: requires-dist
26
+ Dynamic: requires-python
27
+ Dynamic: summary
28
+
29
+ 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](http://akomantoso.org) 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 open.data@oireachtas.ie Data published through these APIs are made available under the [Oireachtas (Open Data) PSI Licence](https://beta.oireachtas.ie/en/open-data/license/) # noqa: E501
30
+
@@ -0,0 +1,132 @@
1
+ # Houses of the Oireachtas Open Data API - Python SDK
2
+
3
+ [![Build Status](https://github.com/Irishsmurf/OireachtasAPI/actions/workflows/ci.yml/badge.svg)](https://github.com/Irishsmurf/OireachtasAPI/actions/workflows/ci.yml)
4
+ [![Version](https://img.shields.io/badge/version-2.0.0-blue.svg)](#)
5
+ [![Python Version](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg)](#)
6
+
7
+ A modern, lightweight Python client SDK for retrieving and querying open parliament data from the national parliament of Ireland (Houses of the Oireachtas).
8
+
9
+ 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](https://data.oireachtas.ie).
10
+
11
+ ---
12
+
13
+ ## 🚀 Key Features
14
+
15
+ * **Modern Python 3 Support:** Fully compatible with Python 3.8+ (legacy Python 2 support has been dropped).
16
+ * **Fully Tested:** Upgraded to use `pytest` with a complete suite of unit (mocked) and integration (live API) tests.
17
+ * **Open Access:** Works out of the box with the public Oireachtas API endpoints (no authentication tokens required).
18
+ * **Automated CI/CD:** GitHub Actions verify compatibility on every push and automatically build & publish new GitHub Releases when tags are created.
19
+
20
+ ---
21
+
22
+ ## 🛠 Installation
23
+
24
+ ### Installing directly from GitHub
25
+
26
+ To install the latest release directly from GitHub:
27
+ ```bash
28
+ pip install git+https://github.com/Irishsmurf/OireachtasAPI.git
29
+ ```
30
+
31
+ ### Local Development Setup
32
+
33
+ To clone the repository and install it in editable mode with development dependencies:
34
+ ```bash
35
+ # Clone the repository
36
+ git clone https://github.com/Irishsmurf/OireachtasAPI.git
37
+ cd OireachtasAPI
38
+
39
+ # Create and activate a virtual environment
40
+ python3 -m venv .venv
41
+ source .venv/bin/activate
42
+
43
+ # Install requirements
44
+ pip install --upgrade pip setuptools wheel
45
+ pip install -r requirements.txt -r test-requirements.txt
46
+ pip install -e .
47
+ ```
48
+
49
+ ---
50
+
51
+ ## 💡 Quick Start Example
52
+
53
+ This code demonstrates how to retrieve the 5 most recent active Constituencies:
54
+
55
+ ```python
56
+ import oireachtas_api
57
+ from pprint import pprint
58
+
59
+ # 1. Initialize the client
60
+ client = oireachtas_api.ConstituenciesApi()
61
+
62
+ try:
63
+ # 2. Query constituencies (limiting to 5 results)
64
+ response = client.constituencies(limit=5)
65
+
66
+ # 3. Print the API response
67
+ print("--- Oireachtas Constituencies ---")
68
+ pprint(response)
69
+ except oireachtas_api.rest.ApiException as e:
70
+ print(f"Failed to query constituencies: {e}")
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 📂 Core API Reference
76
+
77
+ All requests call the live API endpoint: `https://api.oireachtas.ie/v1`.
78
+
79
+ | Service Class | Method API | Description / Use Case | Official Specs |
80
+ | :--- | :--- | :--- | :--- |
81
+ | **`ConstituenciesApi`** | `constituencies()` | Retrieve electoral districts | [Docs](docs/ConstituenciesApi.md) |
82
+ | **`DebatesApi`** | `debates()` | Access official debates transcripts | [Docs](docs/DebatesApi.md) |
83
+ | **`DivisionsApi`** | `divisions()` | Inspect parliamentary votes and counts | [Docs](docs/DivisionsApi.md) |
84
+ | **`HousesApi`** | `houses()` | Query house info (Dáil or Seanad) | [Docs](docs/HousesApi.md) |
85
+ | **`LegislationApi`** | `legislation()` | Query active & historic bills and acts | [Docs](docs/LegislationApi.md) |
86
+ | **`MembersApi`** | `members()` | Look up details of TDs and Senators | [Docs](docs/MembersApi.md) |
87
+ | **`PartiesApi`** | `parties()` | List political parties | [Docs](docs/PartiesApi.md) |
88
+ | **`QuestionsApi`** | `questions()` | Query parliamentary questions (PQs) | [Docs](docs/QuestionsApi.md) |
89
+
90
+ ---
91
+
92
+ ## 🧪 Testing Guide
93
+
94
+ We use `pytest` for unit and integration tests.
95
+
96
+ ### 1. Isolated Unit Tests (Mocked Network)
97
+ To run local test stubs using mock API responses (extremely fast, offline-safe):
98
+ ```bash
99
+ pytest -m "not integration"
100
+ ```
101
+
102
+ ### 2. Live Integration Tests
103
+ To verify compatibility against the real, live Oireachtas API endpoints:
104
+ ```bash
105
+ pytest -m "integration"
106
+ ```
107
+
108
+ ### 3. Run the Whole Test Suite
109
+ To run all tests:
110
+ ```bash
111
+ pytest
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 🏷 Release Automation
117
+
118
+ This project tracks official releases automatically:
119
+ 1. Ensure your version code is up to date in [setup.py](setup.py).
120
+ 2. Commit your changes and tag the master branch:
121
+ ```bash
122
+ git tag v2.0.0
123
+ git push origin v2.0.0
124
+ ```
125
+ 3. The **Release Workflow** will automatically build the package wheels and publish a drafted GitHub Release with build assets attached.
126
+
127
+ ---
128
+
129
+ ## 📬 Contact & Support
130
+
131
+ * **Official API Portal:** [beta.oireachtas.ie/en/open-data](https://beta.oireachtas.ie/en/open-data)
132
+ * **Email:** open.data@oireachtas.ie
@@ -0,0 +1,84 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+
5
+ """
6
+ Houses of the Oireachtas Open Data APIs
7
+
8
+ 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](http://akomantoso.org) 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 open.data@oireachtas.ie Data published through these APIs are made available under the [Oireachtas (Open Data) PSI Licence](https://beta.oireachtas.ie/en/open-data/license/) # noqa: E501
9
+
10
+ OpenAPI spec version: 1.0
11
+ Contact: open.data@oireachtas.ie
12
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
13
+ """
14
+
15
+
16
+
17
+ # import apis into sdk package
18
+ from oireachtas_api.api.constituencies_api import ConstituenciesApi
19
+ from oireachtas_api.api.debates_api import DebatesApi
20
+ from oireachtas_api.api.divisions_api import DivisionsApi
21
+ from oireachtas_api.api.filters_api import FiltersApi
22
+ from oireachtas_api.api.houses_api import HousesApi
23
+ from oireachtas_api.api.legislation_api import LegislationApi
24
+ from oireachtas_api.api.members_api import MembersApi
25
+ from oireachtas_api.api.parties_api import PartiesApi
26
+ from oireachtas_api.api.questions_api import QuestionsApi
27
+
28
+ # import ApiClient
29
+ from oireachtas_api.api_client import ApiClient
30
+ from oireachtas_api.configuration import Configuration
31
+ # import models into sdk package
32
+ from oireachtas_api.models.error_response import ErrorResponse
33
+ from oireachtas_api.models.inline_response200 import InlineResponse200
34
+ from oireachtas_api.models.inline_response2001 import InlineResponse2001
35
+ from oireachtas_api.models.inline_response2001_question import InlineResponse2001Question
36
+ from oireachtas_api.models.inline_response2001_question_by import InlineResponse2001QuestionBy
37
+ from oireachtas_api.models.inline_response2001_question_debate_section import InlineResponse2001QuestionDebateSection
38
+ from oireachtas_api.models.inline_response2001_question_debate_section_formats import InlineResponse2001QuestionDebateSectionFormats
39
+ from oireachtas_api.models.inline_response2001_question_to import InlineResponse2001QuestionTo
40
+ from oireachtas_api.models.inline_response2001_results import InlineResponse2001Results
41
+ from oireachtas_api.models.inline_response2002 import InlineResponse2002
42
+ from oireachtas_api.models.inline_response2002_debate_record import InlineResponse2002DebateRecord
43
+ from oireachtas_api.models.inline_response2002_debate_record_chamber import InlineResponse2002DebateRecordChamber
44
+ from oireachtas_api.models.inline_response2002_debate_record_counts import InlineResponse2002DebateRecordCounts
45
+ from oireachtas_api.models.inline_response2002_debate_record_debate_section import InlineResponse2002DebateRecordDebateSection
46
+ from oireachtas_api.models.inline_response2002_debate_record_debate_section_counts import InlineResponse2002DebateRecordDebateSectionCounts
47
+ from oireachtas_api.models.inline_response2002_debate_record_debate_section_speakers import InlineResponse2002DebateRecordDebateSectionSpeakers
48
+ from oireachtas_api.models.inline_response2002_debate_record_debate_sections import InlineResponse2002DebateRecordDebateSections
49
+ from oireachtas_api.models.inline_response2002_debate_record_house import InlineResponse2002DebateRecordHouse
50
+ from oireachtas_api.models.inline_response2002_results import InlineResponse2002Results
51
+ from oireachtas_api.models.inline_response2003 import InlineResponse2003
52
+ from oireachtas_api.models.inline_response2003_division import InlineResponse2003Division
53
+ from oireachtas_api.models.inline_response2003_division_debate import InlineResponse2003DivisionDebate
54
+ from oireachtas_api.models.inline_response2003_division_house import InlineResponse2003DivisionHouse
55
+ from oireachtas_api.models.inline_response2003_division_subject import InlineResponse2003DivisionSubject
56
+ from oireachtas_api.models.inline_response2003_division_tallies import InlineResponse2003DivisionTallies
57
+ from oireachtas_api.models.inline_response2003_results import InlineResponse2003Results
58
+ from oireachtas_api.models.inline_response2004 import InlineResponse2004
59
+ from oireachtas_api.models.inline_response2004_head import InlineResponse2004Head
60
+ from oireachtas_api.models.inline_response2004_head_counts import InlineResponse2004HeadCounts
61
+ from oireachtas_api.models.inline_response2004_head_date_range import InlineResponse2004HeadDateRange
62
+ from oireachtas_api.models.inline_response2004_member import InlineResponse2004Member
63
+ from oireachtas_api.models.inline_response2004_member_membership import InlineResponse2004MemberMembership
64
+ from oireachtas_api.models.inline_response2004_member_membership_house import InlineResponse2004MemberMembershipHouse
65
+ from oireachtas_api.models.inline_response2004_member_membership_office import InlineResponse2004MemberMembershipOffice
66
+ from oireachtas_api.models.inline_response2004_member_membership_office_date_range import InlineResponse2004MemberMembershipOfficeDateRange
67
+ from oireachtas_api.models.inline_response2004_member_membership_office_office_name import InlineResponse2004MemberMembershipOfficeOfficeName
68
+ from oireachtas_api.models.inline_response2004_member_membership_offices import InlineResponse2004MemberMembershipOffices
69
+ from oireachtas_api.models.inline_response2004_member_membership_parties import InlineResponse2004MemberMembershipParties
70
+ from oireachtas_api.models.inline_response2004_member_membership_party import InlineResponse2004MemberMembershipParty
71
+ from oireachtas_api.models.inline_response2004_member_membership_party_date_range import InlineResponse2004MemberMembershipPartyDateRange
72
+ from oireachtas_api.models.inline_response2004_member_membership_represent import InlineResponse2004MemberMembershipRepresent
73
+ from oireachtas_api.models.inline_response2004_member_membership_represents import InlineResponse2004MemberMembershipRepresents
74
+ from oireachtas_api.models.inline_response2004_member_memberships import InlineResponse2004MemberMemberships
75
+ from oireachtas_api.models.inline_response2004_results import InlineResponse2004Results
76
+ from oireachtas_api.models.inline_response200_bill import InlineResponse200Bill
77
+ from oireachtas_api.models.inline_response200_bill_amendment_lists import InlineResponse200BillAmendmentLists
78
+ from oireachtas_api.models.inline_response200_bill_origin_house import InlineResponse200BillOriginHouse
79
+ from oireachtas_api.models.inline_response200_bill_stages import InlineResponse200BillStages
80
+ from oireachtas_api.models.inline_response200_bill_version import InlineResponse200BillVersion
81
+ from oireachtas_api.models.inline_response200_bill_versions import InlineResponse200BillVersions
82
+ from oireachtas_api.models.inline_response200_head import InlineResponse200Head
83
+ from oireachtas_api.models.inline_response200_head_date_range import InlineResponse200HeadDateRange
84
+ from oireachtas_api.models.inline_response200_results import InlineResponse200Results
@@ -0,0 +1,13 @@
1
+
2
+ # flake8: noqa
3
+
4
+ # import apis into api package
5
+ from oireachtas_api.api.constituencies_api import ConstituenciesApi
6
+ from oireachtas_api.api.debates_api import DebatesApi
7
+ from oireachtas_api.api.divisions_api import DivisionsApi
8
+ from oireachtas_api.api.filters_api import FiltersApi
9
+ from oireachtas_api.api.houses_api import HousesApi
10
+ from oireachtas_api.api.legislation_api import LegislationApi
11
+ from oireachtas_api.api.members_api import MembersApi
12
+ from oireachtas_api.api.parties_api import PartiesApi
13
+ from oireachtas_api.api.questions_api import QuestionsApi
@@ -0,0 +1,144 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Houses of the Oireachtas Open Data APIs
5
+
6
+ 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](http://akomantoso.org) 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 open.data@oireachtas.ie Data published through these APIs are made available under the [Oireachtas (Open Data) PSI Licence](https://beta.oireachtas.ie/en/open-data/license/) # noqa: E501
7
+
8
+ OpenAPI spec version: 1.0
9
+ Contact: open.data@oireachtas.ie
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+
14
+
15
+ import re # noqa: F401
16
+
17
+ # python 2 and python 3 compatibility library
18
+
19
+ from oireachtas_api.api_client import ApiClient
20
+
21
+
22
+ class ConstituenciesApi(object):
23
+ """NOTE: This class is auto generated by the swagger code generator program.
24
+
25
+ Do not edit the class manually.
26
+ Ref: https://github.com/swagger-api/swagger-codegen
27
+ """
28
+
29
+ def __init__(self, api_client=None):
30
+ if api_client is None:
31
+ api_client = ApiClient()
32
+ self.api_client = api_client
33
+
34
+ def constituencies(self, **kwargs): # noqa: E501
35
+ """Constituencies List # noqa: E501
36
+
37
+ Returns list of constituencies filtered by the base and additional parameters. The list supports paging. #### Mapping * Start Date - Greater Than or Equal To - question.date * End Date - Less Than or Equal To - question.date * Skip - Equal To - this will ignore the first x number of records set in the parameter * Limit - Equal To - this will only return a specific amount of records * House/Chamber - house.house.uri # noqa: E501
38
+ This method makes a synchronous HTTP request by default. To make an
39
+ asynchronous HTTP request, please pass async_req=True
40
+ >>> thread = api.constituencies(async_req=True)
41
+ >>> result = thread.get()
42
+
43
+ :param async_req bool
44
+ :param list[str] chamber_id: Filter by house or committee uri. Example /ie/oireachtas/house/dail/32
45
+ :param str chamber: Filter by House name (dail or seanad). Using an empty string retrieves results for both Houses.
46
+ :param int house_no: filter by house number
47
+ :param int skip: This is a base filter which is used on many APIs, allowing skipping of records by a specific integer.
48
+ :param int limit: This is a base filter which is used on many APIs, allowing the limiting of records to a specific integer.
49
+ :return: object
50
+ If the method is called asynchronously,
51
+ returns the request thread.
52
+ """
53
+ kwargs['_return_http_data_only'] = True
54
+ if kwargs.get('async_req'):
55
+ return self.constituencies_with_http_info(**kwargs) # noqa: E501
56
+ else:
57
+ (data) = self.constituencies_with_http_info(**kwargs) # noqa: E501
58
+ return data
59
+
60
+ def constituencies_with_http_info(self, **kwargs): # noqa: E501
61
+ """Constituencies List # noqa: E501
62
+
63
+ Returns list of constituencies filtered by the base and additional parameters. The list supports paging. #### Mapping * Start Date - Greater Than or Equal To - question.date * End Date - Less Than or Equal To - question.date * Skip - Equal To - this will ignore the first x number of records set in the parameter * Limit - Equal To - this will only return a specific amount of records * House/Chamber - house.house.uri # noqa: E501
64
+ This method makes a synchronous HTTP request by default. To make an
65
+ asynchronous HTTP request, please pass async_req=True
66
+ >>> thread = api.constituencies_with_http_info(async_req=True)
67
+ >>> result = thread.get()
68
+
69
+ :param async_req bool
70
+ :param list[str] chamber_id: Filter by house or committee uri. Example /ie/oireachtas/house/dail/32
71
+ :param str chamber: Filter by House name (dail or seanad). Using an empty string retrieves results for both Houses.
72
+ :param int house_no: filter by house number
73
+ :param int skip: This is a base filter which is used on many APIs, allowing skipping of records by a specific integer.
74
+ :param int limit: This is a base filter which is used on many APIs, allowing the limiting of records to a specific integer.
75
+ :return: object
76
+ If the method is called asynchronously,
77
+ returns the request thread.
78
+ """
79
+
80
+ all_params = ['chamber_id', 'chamber', 'house_no', 'skip', 'limit'] # noqa: E501
81
+ all_params.append('async_req')
82
+ all_params.append('_return_http_data_only')
83
+ all_params.append('_preload_content')
84
+ all_params.append('_request_timeout')
85
+
86
+ params = locals()
87
+ for key, val in params['kwargs'].items():
88
+ if key not in all_params:
89
+ raise TypeError(
90
+ "Got an unexpected keyword argument '%s'"
91
+ " to method constituencies" % key
92
+ )
93
+ params[key] = val
94
+ del params['kwargs']
95
+
96
+ collection_formats = {}
97
+
98
+ path_params = {}
99
+
100
+ query_params = []
101
+ if 'chamber_id' in params:
102
+ query_params.append(('chamber_id', params['chamber_id'])) # noqa: E501
103
+ collection_formats['chamber_id'] = 'csv' # noqa: E501
104
+ if 'chamber' in params:
105
+ query_params.append(('chamber', params['chamber'])) # noqa: E501
106
+ if 'house_no' in params:
107
+ query_params.append(('house_no', params['house_no'])) # noqa: E501
108
+ if 'skip' in params:
109
+ query_params.append(('skip', params['skip'])) # noqa: E501
110
+ if 'limit' in params:
111
+ query_params.append(('limit', params['limit'])) # noqa: E501
112
+
113
+ header_params = {}
114
+
115
+ form_params = []
116
+ local_var_files = {}
117
+
118
+ body_params = None
119
+ # HTTP header `Accept`
120
+ header_params['Accept'] = self.api_client.select_header_accept(
121
+ ['application/json']) # noqa: E501
122
+
123
+ # HTTP header `Content-Type`
124
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
125
+ ['application/json']) # noqa: E501
126
+
127
+ # Authentication setting
128
+ auth_settings = [] # noqa: E501
129
+
130
+ return self.api_client.call_api(
131
+ '/constituencies', 'GET',
132
+ path_params,
133
+ query_params,
134
+ header_params,
135
+ body=body_params,
136
+ post_params=form_params,
137
+ files=local_var_files,
138
+ response_type='object', # noqa: E501
139
+ auth_settings=auth_settings,
140
+ async_req=params.get('async_req'),
141
+ _return_http_data_only=params.get('_return_http_data_only'),
142
+ _preload_content=params.get('_preload_content', True),
143
+ _request_timeout=params.get('_request_timeout'),
144
+ collection_formats=collection_formats)
@@ -0,0 +1,160 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Houses of the Oireachtas Open Data APIs
5
+
6
+ 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](http://akomantoso.org) 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 open.data@oireachtas.ie Data published through these APIs are made available under the [Oireachtas (Open Data) PSI Licence](https://beta.oireachtas.ie/en/open-data/license/) # noqa: E501
7
+
8
+ OpenAPI spec version: 1.0
9
+ Contact: open.data@oireachtas.ie
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+
14
+
15
+ import re # noqa: F401
16
+
17
+ # python 2 and python 3 compatibility library
18
+
19
+ from oireachtas_api.api_client import ApiClient
20
+
21
+
22
+ class DebatesApi(object):
23
+ """NOTE: This class is auto generated by the swagger code generator program.
24
+
25
+ Do not edit the class manually.
26
+ Ref: https://github.com/swagger-api/swagger-codegen
27
+ """
28
+
29
+ def __init__(self, api_client=None):
30
+ if api_client is None:
31
+ api_client = ApiClient()
32
+ self.api_client = api_client
33
+
34
+ def debates(self, **kwargs): # noqa: E501
35
+ """Debates List # noqa: E501
36
+
37
+ Returns list of debates filtered by the base and additional parameters. The list supports paging. #### Mapping * Start Date - Greater Than or Equal To - debateRecord.date * End Date - Less Than or Equal To - debateRecord.date * Skip - Equal To - this will ignore the first x number of records set in the parameter * Limit - Equal To - this will only return a specific amount of records # noqa: E501
38
+ This method makes a synchronous HTTP request by default. To make an
39
+ asynchronous HTTP request, please pass async_req=True
40
+ >>> thread = api.debates(async_req=True)
41
+ >>> result = thread.get()
42
+
43
+ :param async_req bool
44
+ :param str chamber_type: Filter results by House, ie, Dáil or Seanad or committees.
45
+ :param list[str] chamber_id: Filter by house or committee uri. Example /ie/oireachtas/house/dail/32
46
+ :param str chamber: Filter by House name (dail or seanad). Using an empty string retrieves results for both Houses.
47
+ :param date date_start: This is a base filter which is used on many APIs, allowing filtering by Start Date related to the Section.
48
+ :param date date_end: This is a base filter which is used on many APIs, allowing filtering by End Date related to the Section.
49
+ :param int skip: This is a base filter which is used on many APIs, allowing skipping of records by a specific integer.
50
+ :param int limit: This is a base filter which is used on many APIs, allowing the limiting of records to a specific integer.
51
+ :param str member_id: Filter by Member uri.
52
+ :param str debate_id: Filter by debate uri
53
+ :return: InlineResponse2002
54
+ If the method is called asynchronously,
55
+ returns the request thread.
56
+ """
57
+ kwargs['_return_http_data_only'] = True
58
+ if kwargs.get('async_req'):
59
+ return self.debates_with_http_info(**kwargs) # noqa: E501
60
+ else:
61
+ (data) = self.debates_with_http_info(**kwargs) # noqa: E501
62
+ return data
63
+
64
+ def debates_with_http_info(self, **kwargs): # noqa: E501
65
+ """Debates List # noqa: E501
66
+
67
+ Returns list of debates filtered by the base and additional parameters. The list supports paging. #### Mapping * Start Date - Greater Than or Equal To - debateRecord.date * End Date - Less Than or Equal To - debateRecord.date * Skip - Equal To - this will ignore the first x number of records set in the parameter * Limit - Equal To - this will only return a specific amount of records # noqa: E501
68
+ This method makes a synchronous HTTP request by default. To make an
69
+ asynchronous HTTP request, please pass async_req=True
70
+ >>> thread = api.debates_with_http_info(async_req=True)
71
+ >>> result = thread.get()
72
+
73
+ :param async_req bool
74
+ :param str chamber_type: Filter results by House, ie, Dáil or Seanad or committees.
75
+ :param list[str] chamber_id: Filter by house or committee uri. Example /ie/oireachtas/house/dail/32
76
+ :param str chamber: Filter by House name (dail or seanad). Using an empty string retrieves results for both Houses.
77
+ :param date date_start: This is a base filter which is used on many APIs, allowing filtering by Start Date related to the Section.
78
+ :param date date_end: This is a base filter which is used on many APIs, allowing filtering by End Date related to the Section.
79
+ :param int skip: This is a base filter which is used on many APIs, allowing skipping of records by a specific integer.
80
+ :param int limit: This is a base filter which is used on many APIs, allowing the limiting of records to a specific integer.
81
+ :param str member_id: Filter by Member uri.
82
+ :param str debate_id: Filter by debate uri
83
+ :return: InlineResponse2002
84
+ If the method is called asynchronously,
85
+ returns the request thread.
86
+ """
87
+
88
+ all_params = ['chamber_type', 'chamber_id', 'chamber', 'date_start', 'date_end', 'skip', 'limit', 'member_id', 'debate_id'] # noqa: E501
89
+ all_params.append('async_req')
90
+ all_params.append('_return_http_data_only')
91
+ all_params.append('_preload_content')
92
+ all_params.append('_request_timeout')
93
+
94
+ params = locals()
95
+ for key, val in params['kwargs'].items():
96
+ if key not in all_params:
97
+ raise TypeError(
98
+ "Got an unexpected keyword argument '%s'"
99
+ " to method debates" % key
100
+ )
101
+ params[key] = val
102
+ del params['kwargs']
103
+
104
+ collection_formats = {}
105
+
106
+ path_params = {}
107
+
108
+ query_params = []
109
+ if 'chamber_type' in params:
110
+ query_params.append(('chamber_type', params['chamber_type'])) # noqa: E501
111
+ if 'chamber_id' in params:
112
+ query_params.append(('chamber_id', params['chamber_id'])) # noqa: E501
113
+ collection_formats['chamber_id'] = 'csv' # noqa: E501
114
+ if 'chamber' in params:
115
+ query_params.append(('chamber', params['chamber'])) # noqa: E501
116
+ if 'date_start' in params:
117
+ query_params.append(('date_start', params['date_start'])) # noqa: E501
118
+ if 'date_end' in params:
119
+ query_params.append(('date_end', params['date_end'])) # noqa: E501
120
+ if 'skip' in params:
121
+ query_params.append(('skip', params['skip'])) # noqa: E501
122
+ if 'limit' in params:
123
+ query_params.append(('limit', params['limit'])) # noqa: E501
124
+ if 'member_id' in params:
125
+ query_params.append(('member_id', params['member_id'])) # noqa: E501
126
+ if 'debate_id' in params:
127
+ query_params.append(('debate_id', params['debate_id'])) # noqa: E501
128
+
129
+ header_params = {}
130
+
131
+ form_params = []
132
+ local_var_files = {}
133
+
134
+ body_params = None
135
+ # HTTP header `Accept`
136
+ header_params['Accept'] = self.api_client.select_header_accept(
137
+ ['application/json']) # noqa: E501
138
+
139
+ # HTTP header `Content-Type`
140
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
141
+ ['application/json']) # noqa: E501
142
+
143
+ # Authentication setting
144
+ auth_settings = [] # noqa: E501
145
+
146
+ return self.api_client.call_api(
147
+ '/debates', 'GET',
148
+ path_params,
149
+ query_params,
150
+ header_params,
151
+ body=body_params,
152
+ post_params=form_params,
153
+ files=local_var_files,
154
+ response_type='InlineResponse2002', # noqa: E501
155
+ auth_settings=auth_settings,
156
+ async_req=params.get('async_req'),
157
+ _return_http_data_only=params.get('_return_http_data_only'),
158
+ _preload_content=params.get('_preload_content', True),
159
+ _request_timeout=params.get('_request_timeout'),
160
+ collection_formats=collection_formats)