Skip to content

Commit

Permalink
add option to skip download existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Binh Vu committed Jan 8, 2024
1 parent 3e4b19f commit 7db7965
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion kgdata/misc/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def list_files(
return files

def create_download_jobs(
self, files: list[DumpFile], rootdir: str | Path
self, files: list[DumpFile], rootdir: str | Path, skip_if_exists: bool = True
) -> list[tuple[str, Path]]:
rootdir = Path(rootdir)
main_category_urls = {
Expand All @@ -143,6 +143,8 @@ def create_download_jobs(
jobs = []
for file in files:
outfile = dump_dir / get_url_filename(file.url)
if outfile.exists() and skip_if_exists:
continue
jobs.append((file.url, outfile))
return jobs

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kgdata"
version = "6.2.0"
version = "6.2.1"
description = "Library to process dumps of knowledge graphs (Wikipedia, DBpedia, Wikidata)"
readme = "README.md"
authors = [{ name = "Binh Vu", email = "binh@toan2.com" }]
Expand Down

0 comments on commit 7db7965

Please sign in to comment.