import json import os import shutil import requests RELEASE_STATS_URL = "https://commonvoice.mozilla.org/dist/releases/{}.json" VERSIONS = [ {"semver": "1.0.0", "name": "common_voice_1_0", "release": "cv-corpus-1"}, {"semver": "2.0.0", "name": "common_voice_2_0", "release": "cv-corpus-2"}, {"semver": "3.0.0", "name": "common_voice_3_0", "release": "cv-corpus-3"}, { "semver": "4.0.0", "name": "common_voice_4_0", "release": "cv-corpus-4-2019-12-10", }, { "semver": "5.0.0", "name": "common_voice_5_0", "release": "cv-corpus-5-2020-06-22", }, { "semver": "5.1.0", "name": "common_voice_5_1", "release": "cv-corpus-5.1-2020-06-22", }, { "semver": "6.0.0", "name": "common_voice_6_0", "release": "cv-corpus-6.0-2020-12-11", }, { "semver": "6.1.0", "name": "common_voice_6_1", "release": "cv-corpus-6.1-2020-12-11", }, { "semver": "7.0.0", "name": "common_voice_7_0", "release": "cv-corpus-7.0-2021-07-21", }, { "semver": "8.0.0", "name": "common_voice_8_0", "release": "cv-corpus-8.0-2022-01-19", }, { "semver": "9.0.0", "name": "common_voice_9_0", "release": "cv-corpus-9.0-2022-04-27", }, { "semver": "10.0.0", "name": "common_voice_10_0", "release": "cv-corpus-10.0-2022-07-04", }, { "semver": "11.0.0", "name": "common_voice_11_0", "release": "cv-corpus-11.0-2022-09-21", }, ] def num_to_size(num: int): if num < 1000: return "n<1K" elif num < 10_000: return "1K