99"""
1010
1111import sunlight .service
12- from sunlight .service import EntityList
13- from sunlight .service import EntityDict
12+ from sunlight .service import EntityDict , EntityList
13+ from sunlight .pagination import pageable
1414import json
1515
1616
@@ -51,6 +51,9 @@ class Congress(sunlight.service.Service):
5151 is the place to look for help on field names and examples.
5252 """
5353
54+ is_pageable = True
55+
56+ @pageable
5457 def legislators (self , ** kwargs ):
5558 """
5659 Search and filter for members of Congress.
@@ -60,6 +63,7 @@ def legislators(self, **kwargs):
6063 """
6164 return self .get ('legislators' , ** kwargs )
6265
66+ @pageable
6367 def legislator (self , identifier , id_type = LEGISLATOR_ID_TYPES [0 ], ** kwargs ):
6468 """
6569 Retrieve a member of Congress by a unique identifier. Defaults to
@@ -91,7 +95,6 @@ def legislator(self, identifier, id_type=LEGISLATOR_ID_TYPES[0], **kwargs):
9195 return EntityDict (results [0 ], results ._meta )
9296 return None
9397
94-
9598 def all_legislators_in_office (self , ** kwargs ):
9699 """
97100 Returns all legislators currently in office (non-paginated response).
@@ -104,6 +107,7 @@ def all_legislators_in_office(self, **kwargs):
104107 })
105108 return self .get ('legislators' , ** kwargs )
106109
110+ @pageable
107111 def locate_legislators_by_lat_lon (self , lat , lon , ** kwargs ):
108112 """
109113 Find members of Congress by a latitude and longitude.
@@ -117,6 +121,7 @@ def locate_legislators_by_lat_lon(self, lat, lon, **kwargs):
117121 })
118122 return self .get ('legislators/locate' , ** kwargs )
119123
124+ @pageable
120125 def locate_legislators_by_zip (self , zipcode , ** kwargs ):
121126 """
122127 Find members of Congress by zip code.
@@ -129,6 +134,7 @@ def locate_legislators_by_zip(self, zipcode, **kwargs):
129134 })
130135 return self .get ('legislators/locate' , ** kwargs )
131136
137+ @pageable
132138 def bills (self , ** kwargs ):
133139 """
134140 Search and filter through bills in Congress.
@@ -138,6 +144,7 @@ def bills(self, **kwargs):
138144 """
139145 return self .get ('bills' , ** kwargs )
140146
147+ @pageable
141148 def bill (self , bill_id , ** kwargs ):
142149 """
143150 Retrieve a bill by bill_id.
@@ -153,6 +160,7 @@ def bill(self, bill_id, **kwargs):
153160 return EntityDict (results [0 ], results ._meta )
154161 return None
155162
163+ @pageable
156164 def search_bills (self , query , ** kwargs ):
157165 """
158166 Search the full text of legislation, and other fields.
@@ -165,6 +173,7 @@ def search_bills(self, query, **kwargs):
165173 })
166174 return self .get ('bills/search' , ** kwargs )
167175
176+ @pageable
168177 def upcoming_bills (self , ** kwargs ):
169178 """
170179 Search and filter through upcoming bills in the House and Senate.
@@ -177,6 +186,7 @@ def upcoming_bills(self, **kwargs):
177186 """
178187 return self .get ('upcoming_bills' , ** kwargs )
179188
189+ @pageable
180190 def locate_districts_by_lat_lon (self , lat , lon , ** kwargs ):
181191 """
182192 Find congressional districts by a latitude and longitude.
@@ -190,6 +200,7 @@ def locate_districts_by_lat_lon(self, lat, lon, **kwargs):
190200 })
191201 return self .get ('/districts/locate' , ** kwargs )
192202
203+ @pageable
193204 def locate_districts_by_zip (self , zipcode , ** kwargs ):
194205 """
195206 Find congressional districts by a latitude and longitude.
@@ -202,6 +213,7 @@ def locate_districts_by_zip(self, zipcode, **kwargs):
202213 })
203214 return self .get ('/districts/locate' , ** kwargs )
204215
216+ @pageable
205217 def committees (self , ** kwargs ):
206218 """
207219 Search and filter through committees in the House and Senate.
@@ -211,6 +223,7 @@ def committees(self, **kwargs):
211223 """
212224 return self .get ('committees' , ** kwargs )
213225
226+ @pageable
214227 def amendments (self , ** kwargs ):
215228 """
216229 Search and filter through amendments in Congress.
@@ -220,6 +233,7 @@ def amendments(self, **kwargs):
220233 """
221234 return self .get ('amendments' , ** kwargs )
222235
236+ @pageable
223237 def votes (self , ** kwargs ):
224238 """
225239 Search and filter through votes in Congress.
@@ -229,6 +243,7 @@ def votes(self, **kwargs):
229243 """
230244 return self .get ('votes' , ** kwargs )
231245
246+ @pageable
232247 def floor_updates (self , ** kwargs ):
233248 """
234249 Search and filter through floor updates in the House and Senate.
@@ -238,6 +253,7 @@ def floor_updates(self, **kwargs):
238253 """
239254 return self .get ('floor_updates' , ** kwargs )
240255
256+ @pageable
241257 def hearings (self , ** kwargs ):
242258 """
243259 Search and filter through committee hearings in the House and Senate.
@@ -247,6 +263,7 @@ def hearings(self, **kwargs):
247263 """
248264 return self .get ('hearings' , ** kwargs )
249265
266+ @pageable
250267 def nominations (self , ** kwargs ):
251268 """
252269 Search and filter through presidential nominations in Congress.
0 commit comments