GeofabrikDownloader.get_raw_directory_index¶
- classmethod GeofabrikDownloader.get_raw_directory_index(url, save_path=None, verbose=False, raise_error=False)[source]¶
Get a raw directory index (including download information of older file logs).
- Parameters:
url (str) – URL of a web page of a data resource (e.g. a subregion)
save_path (str | pathlib.Path | None)
verbose (bool | int) – whether to print relevant information in console, defaults to
Falseraise_error (bool) – Whether to raise the provided exception; if
raise_error=False(default), the error will be suppressed.
- Returns:
information of raw directory index
- Return type:
pandas.DataFrame | None
Examples:
>>> from pydriosm.downloader import GeofabrikDownloader >>> gfd = GeofabrikDownloader() >>> raw_directory_index = gfd.get_raw_directory_index(gfd.URL, verbose=True) Collecting the raw directory index on 'https://download.geofabrik.de/' ... Failed. ... >>> raw_directory_index is None True >>> url = 'https://download.geofabrik.de/europe/great-britain.html' >>> raw_directory_index = gfd.get_raw_directory_index(url) >>> type(raw_directory_index) pandas.DataFrame >>> raw_directory_index.columns.tolist() ['file', 'date', 'size', 'metric_file_size', 'url']