pyrosm.OSM.clear_downloads

pyrosm.OSM.clear_downloads#

static OSM.clear_downloads(filepath=None)#

Remove PBF files downloaded or cropped into the default download directory (<tempdir>/pyrosm), with the partial files that interrupted downloads leave and the records kept beside crops. The result cache, the provider indexes and the bundled package datasets are left untouched.

Parameters:

filepath (str | os.PathLike (optional)) – A .osm.pbf or .osh.pbf file to remove, with its partial files: a path removes exactly that file, a bare file name the file of that name in the download directory. When None (default) every *.pbf file in the download directory is removed.

Returns:

The number of PBF and partial files removed.

Return type:

int

Raises:

ValueError – If filepath does not name a .osm.pbf or .osh.pbf file.