mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-22 05:45:02 +01:00
csv_metadata_quality/check.py: Parameterize AGROVOC request
This commit is contained in:
parent
5fcaa63bd5
commit
2a1566af62
@ -232,11 +232,10 @@ def agrovoc(field, field_name):
|
|||||||
|
|
||||||
# Try to split multi-value field on "||" separator
|
# Try to split multi-value field on "||" separator
|
||||||
for value in field.split("||"):
|
for value in field.split("||"):
|
||||||
request_url = (
|
request_url = "http://agrovoc.uniroma2.it/agrovoc/rest/v1/agrovoc/search"
|
||||||
f"http://agrovoc.uniroma2.it/agrovoc/rest/v1/agrovoc/search?query={value}"
|
request_params = {"query": value}
|
||||||
)
|
|
||||||
|
|
||||||
request = requests.get(request_url)
|
request = requests.get(request_url, params=request_params)
|
||||||
|
|
||||||
if request.status_code == requests.codes.ok:
|
if request.status_code == requests.codes.ok:
|
||||||
data = request.json()
|
data = request.json()
|
||||||
|
Loading…
Reference in New Issue
Block a user