Skip to content

Commit 2482158

Browse files
committed
Improvement: Added version number to license data
1 parent e752f7f commit 2482158

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/1-fetch/museums_victoria_fetch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import argparse
88
import csv
99
import os
10+
import re
1011
import sys
1112
import textwrap
1213
import traceback
@@ -17,8 +18,6 @@
1718
from pygments import highlight
1819
from pygments.formatters import TerminalFormatter
1920
from pygments.lexers import PythonTracebackLexer
20-
from requests.adapters import HTTPAdapter
21-
from urllib3.util.retry import Retry
2221

2322
# Add parent directory so shared can be imported
2423
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
@@ -202,6 +201,10 @@ def fetch_museums_victoria_data(args, session):
202201

203202
# COUNTING THE UNIQUE LICENCE TYPES
204203
license_short_name = licence_data.get("shortName")
204+
version_number = re.search(r"\b\d+\.\d+\b", licence_data.get("name"))
205+
if version_number:
206+
license_short_name = f"{license_short_name} {version_number.group()}"
207+
205208
if license_short_name:
206209
licences_count[license_short_name] += 1
207210

0 commit comments

Comments
 (0)