Skip to content

Commit 1dd931e

Browse files
committed
use american "license" for consistency with other scripts and publications
1 parent 02fea36 commit 1dd931e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/1-fetch/museums_victoria_fetch.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def fetch_museums_victoria_data(args, session):
150150

151151
record_counts = defaultdict(lambda: defaultdict(int))
152152
media_counts = defaultdict(lambda: defaultdict(int))
153-
licences_count = defaultdict(int)
153+
licenses_count = defaultdict(int)
154154

155155
# Iterate through each record type
156156
for record_type in RECORD_TYPES:
@@ -160,7 +160,7 @@ def fetch_museums_victoria_data(args, session):
160160
per_page = min(PER_PAGE, args.limit) if args.limit else PER_PAGE
161161

162162
while True:
163-
# 1. Construct the API query parameters
163+
# Construct the API query parameters
164164
params = {
165165
"envelope": "true",
166166
"page": current_page,
@@ -187,26 +187,26 @@ def fetch_museums_victoria_data(args, session):
187187
records_processed += 1
188188
media_list = res.get("media", [])
189189
for media_item in media_list:
190-
licence_data = media_item.get("licence")
190+
license_data = media_item.get("license")
191191

192-
# COUNTING THE UNIQUE LICENCE TYPES
193-
license_short_name = licence_data.get("shortName")
192+
# Counting the unique license types
193+
license_short_name = license_data.get("shortName")
194194
version_number = re.search(
195-
r"\b\d+\.\d+\b", licence_data.get("name")
195+
r"\b\d+\.\d+\b", license_data.get("name")
196196
)
197197
if version_number:
198198
license_short_name = (
199199
f"{license_short_name} {version_number.group()}"
200200
)
201201

202202
if license_short_name:
203-
licences_count[license_short_name] += 1
203+
licenses_count[license_short_name] += 1
204204

205-
# COUNTING LICENSES BY MEDIA TYPES
205+
# Counting licenses by media types
206206
media_type = media_item.get("type")
207207
media_counts[media_type][license_short_name] += 1
208208

209-
# COUNTING LICENSES BY RECORD TYPES
209+
# Counting licenses by record types
210210
record_counts[record_type][license_short_name] += 1
211211
if total_pages is None:
212212
headers = data.get("headers", {})
@@ -224,7 +224,7 @@ def fetch_museums_victoria_data(args, session):
224224
break
225225

226226
return {
227-
FILE1_COUNT: dict(sorted(licences_count.items())),
227+
FILE1_COUNT: dict(sorted(licenses_count.items())),
228228
FILE2_MEDIA: sort_nested_defaultdict(media_counts),
229229
FILE3_RECORD: sort_nested_defaultdict(record_counts),
230230
}

0 commit comments

Comments
 (0)