|
I'd like to treat our team's Uwazi translations as 'ground truth' when updating other tools like paper forms. Is there a way to batch download all thesauri to CSVs? I see that uploading from CSV is possible |
Replies: 2 comments
|
Hi @CBroz1, Thank you for your question. As you mentioned it is possible to import thesauri items from a CSV file, but unfortunately it is not possible at the moment to download all your thesauri items to a CSV from within Uwazi. However you could use the API to get all your thesauri items in json format that then you could manipulate as you need. |
|
Thanks, @aphilop ! For the benefit of future readers, or just my future self ... Fetching from the API with pythonimport requests
uwazi_instance_api = "https://<your-instance-name>/api/"
session = requests.Session()
login = session.post(
f"{uwazi_instance_api}login",
json={"username": "USERNAME", "password": "PASSWORD"},
)
if login.status_code != 200:
print(login.text)
exit()
translations = session.get(f"{uwazi_instance_api}translations")
dictionaries = session.get(f"{uwazi_instance_api}dictionaries") |
Hi @CBroz1,
Thank you for your question. As you mentioned it is possible to import thesauri items from a CSV file, but unfortunately it is not possible at the moment to download all your thesauri items to a CSV from within Uwazi.
However you could use the API to get all your thesauri items in json format that then you could manipulate as you need.
Simply log in to your instance, point to
https://<your-instance-name>/api/dictionaries, and save the results to a .json file.If you have translated your thesauri in different languages and you also want to get the translations, use
https://<your-instance-name>/api/translations, save the results again as a .json file, and then you could search for