Skip to content

Commit

Permalink
Fix dump by increasing limit (#31)
Browse files Browse the repository at this point in the history
* added catch in dump and upped page limit and size

* bump patch
  • Loading branch information
davidschober authored Mar 18, 2024
1 parent 21f07b9 commit c2385c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions nuldc/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import concurrent.futures
import datetime
import os
import sys


API = "https://api.dc.library.northwestern.edu/api/v2"
Expand Down Expand Up @@ -64,15 +65,17 @@ def dump_collection(col_id):

params = {
"query": f"collection.id:{col_id}",
"size": "25",
"size": "100",
"sort": "id:asc"}
data = helpers.get_search_results(API,
"works",
params, all_results=True)

col_title = data['data'][0]['collection']['title']
filename = f"{slugify(col_title)}-{col_id}"
save_files(filename, data)
params, all_results=True, page_limit=5000)
try:
col_title = data['data'][0]['collection']['title']
filename = f"{slugify(col_title)}-{col_id}"
save_files(filename, data)
except Exception as e:
sys.exit(f"Error with collection {col_id}: {e} \n\n CONTEXT: {data}")


def dump_collections(query_string):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nuldc"
version = "0.9.0"
version = "0.9.1"
description = ""
authors = ["davidschober <davidschob@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit c2385c8

Please sign in to comment.