ipums / ipumsr

Request, download, and read IPUMS data in R
https://tech.popdata.org/ipumsr/
Mozilla Public License 2.0
20 stars 4 forks source link

Pagination #33

Closed renae-r closed 1 year ago

renae-r commented 1 year ago

The misspelling in the branch name is bad and I feel bad.

robe2037 commented 1 year ago

Renamed a few functions and reorganized, but largely kept the proposed changes. Retained the low-level API request function and added a designated helper to create URLs for extract endpoints.

Tried to generalize pagination features to paginated metadata endpoints but ultimately opted to keep these separate for now as they do require slightly different handling. Renamed to get_extract_pages() to emphasize the distinction.

robe2037 commented 1 year ago

On second thought, took a stab at standardizing request handling across extract and metadata endpoints. We now have a more general approach to basic requests and paged requests, which can be used for both extract and metadata endpoints. There are still a few wrappers of the generalized ipums_api_request() for convenience.

robe2037 commented 1 year ago

Combined get_recent_extracts_info() and get_extract_history(), which also required better handling of cases where the requested number of records exceeds the page size limit, but is not infinite.