This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Download all available audio books from DB ICE Portal.""" | |
import json | |
import os | |
import urllib.parse | |
import urllib.request | |
BASE = 'http://iceportal.de/api1/rs/' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""os.walk() variation with Google Drive API.""" | |
import os | |
from apiclient.discovery import build # pip install google-api-python-client | |
FOLDER = 'application/vnd.google-apps.folder' | |
def get_credentials(scopes, *, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Download all sheets of a Google Docs spreadsheet as CSV.""" | |
import contextlib, csv, itertools, os | |
from apiclient.discovery import build # pip install google-api-python-client | |
SHEET = '1dR13B3Wi_KJGUJQ0BZa2frLAVxhZnbz0hpwCcWSvb20' | |
def get_credentials(scopes, *, secrets='~/client_secrets.json', storage='~/storage.json'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Implement `urllib.urlretrieve(url, filename)` with requests library.""" | |
import contextlib | |
import os | |
import urllib | |
import requests | |
def urlretrieve(url: str, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Download and parse https://www.ethnologue.com code files.""" | |
from __future__ import annotations | |
from collections.abc import Iterable, Iterator, Mapping | |
import contextlib | |
import csv | |
import enum | |
import fnmatch | |
import functools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Download and parse ISO 639-3 code tables from https://www.sil.org.""" | |
from __future__ import annotations | |
from collections.abc import Iterable, Iterator, Mapping | |
import contextlib | |
import csv | |
import enum | |
import fnmatch | |
import functools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Benchmark FCA concepts lattice generation with bob_ross.csv.""" | |
from collections.abc import Iterable, Iterator, Sequence | |
import csv | |
import os | |
import pathlib | |
import time | |
from typing import NamedTuple, Optional | |
import urllib.request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Compare ways to return HTML tree streamed and parsed from a given URL.""" | |
import contextlib | |
from typing import Literal, overload | |
import urllib.request | |
import xml.etree.ElementTree as etree | |
import certifi | |
import html5lib | |
import lxml.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Use advanced XPath features of lxml (see also scrapy parsel).""" | |
from __future__ import annotations | |
from typing import Optional | |
import urllib.request | |
import lxml.etree | |
import lxml.html |
NewerOlder