From: Benjamin Mako Hill Date: Tue, 28 Feb 2023 01:06:11 +0000 (-0800) Subject: urlencode tags in the urls we're generating X-Git-Url: https://code.communitydata.science/taguette_google_sheet_integration.git/commitdiff_plain/1c00df80efa0ee43137c63013cc981c905624996 urlencode tags in the urls we're generating --- diff --git a/taguette-export_tags_to_csv.py b/taguette-export_tags_to_csv.py index d0fd28c..a3c163f 100755 --- a/taguette-export_tags_to_csv.py +++ b/taguette-export_tags_to_csv.py @@ -6,6 +6,7 @@ import sqlite3 from configparser import ConfigParser import csv import os +import urllib.parse config_files = [f for f in os.listdir() if f.startswith('.taguette_gdocs')] @@ -58,6 +59,7 @@ for file_path in config_files: category = "" # create a URL that will link to the list of highlights - url = f"https://taguette.communitydata.science/project/{project_id}/highlights/{tag}" + tag_url = urllib.parse.quote(tag) + url = f"https://taguette.communitydata.science/project/{project_id}/highlights/{tag_url}" writer.writerow([str(tag_id), axial, tag, category, description, url])