INNER CODE UNIT · Python

resp

Zverik/every_door · tools/json_to_sqlite.py:123

        resp = requests.get(BASE_URL + filename)
        if resp.status_code != 200:
            print(f'Error {resp.status_code} while downloading {filename}')
            sys.exit(2)
        return resp.json()


def normalize(s: Optional[str]) -> Optional[str]:
    """Normalizes unicode and lowers case for searching."""
    if not s:
        return s
    return u"".join([c for c in unicodedata.normalize('NFKD', s.lower().strip())
                     if not unicodedata.combining(c)])


def store_version(cur):
    version = datetime.datetime.now().strftime('%Y%m%d-%H%M')
    cur.execute("create table version (version text)")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…