Skip to content

feat: allow rows parameter and no pagination (get first n elements)#73

Open
manuelguzmandao wants to merge 2 commits intofabiobatalha:masterfrom
manuelguzmandao:master
Open

feat: allow rows parameter and no pagination (get first n elements)#73
manuelguzmandao wants to merge 2 commits intofabiobatalha:masterfrom
manuelguzmandao:master

Conversation

@manuelguzmandao
Copy link

@manuelguzmandao manuelguzmandao commented Dec 10, 2024

There are 2 contributions in the PR:

  1. Allow using the rows parameter in the request: sets the size of the page to retrieve. This allows to get the first n elements (used with the pagination off) and to retrieve bigger pages in case of harvesting to reduce the amount of requests to the API.
  2. Turn pagination off: used with the rows parameter, it allows to get the first n elements of a request (the most pertinent ones).

Usage:

works = Works(request_params={'rows': 5}, pagination=False)
query = works.filter(<your filter>) # the first 5 elements will be retrieved
for item in query:
    do something...

This PR handles issue #13

@david-rohrschneider
Copy link

+1 for this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants