Skip to content

Commit

Permalink
Tools: add a script to download Unicode data files
Browse files Browse the repository at this point in the history
  • Loading branch information
cpplearner committed Mar 4, 2024
1 parent c53ac59 commit 13db7c9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tools/unicode_properties_parse/download_unicode_data_files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from urllib.request import urlretrieve


Unicode_data_files = {
"DerivedCoreProperties.txt": "https://www.unicode.org/Public/UCD/latest/ucd/DerivedCoreProperties.txt",
"DerivedGeneralCategory.txt": "https://www.unicode.org/Public/UCD/latest/ucd/extracted/DerivedGeneralCategory.txt",
"EastAsianWidth.txt": "https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt",
"GraphemeBreakProperty.txt": "https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakProperty.txt",
"GraphemeBreakText.txt": "https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt",
"emoji-data.txt": "https://www.unicode.org/Public/UCD/latest/ucd/emoji/emoji-data.txt",
}

def download_unicode_data_files():
for filename, url in Unicode_data_files.items():
print(f"downloading {filename} from {url}")
urlretrieve(url, filename)


if __name__ == "__main__":
download_unicode_data_files()

0 comments on commit 13db7c9

Please sign in to comment.