@@ -252,7 +252,10 @@ def url(self):
252
252
if l_params :
253
253
return self .url_collection + "?" + "&" .join (l_params )
254
254
255
- return self .url_collection
255
+ def count (self ):
256
+ _ , m = self .get (return_meta = True , per_page = 1 )
257
+
258
+ return m ["count" ]
256
259
257
260
def get (self , return_meta = False , page = None , per_page = None , cursor = None ):
258
261
@@ -295,21 +298,21 @@ def get(self, return_meta=False, page=None, per_page=None, cursor=None):
295
298
return results
296
299
297
300
def paginate (self , per_page = None , cursor = "*" , n_max = 10000 ):
298
- """Used for paging results of large responses using cursor paging.
299
-
300
- OpenAlex offers two methods for paging: basic paging and cursor paging.
301
- Both methods are supported by PyAlex, although cursor paging seems to be
301
+ """Used for paging results of large responses using cursor paging.
302
+
303
+ OpenAlex offers two methods for paging: basic paging and cursor paging.
304
+ Both methods are supported by PyAlex, although cursor paging seems to be
302
305
easier to implement and less error-prone.
303
306
304
307
Args:
305
308
per_page (_type_, optional): Entries per page to return. Defaults to None.
306
309
cursor (str, optional): _description_. Defaults to "*".
307
- n_max (int, optional): Number of max results (not pages) to return.
310
+ n_max (int, optional): Number of max results (not pages) to return.
308
311
Defaults to 10000.
309
312
310
313
Returns:
311
- CursorPaginator: Iterator to use for returning and processing each page
312
- result in sequence.
314
+ CursorPaginator: Iterator to use for returning and processing each page
315
+ result in sequence.
313
316
"""
314
317
return CursorPaginator (self , per_page = per_page , cursor = cursor , n_max = n_max )
315
318
0 commit comments