Skip to content

Commit 464ec4f

Browse files
committed
refactor: iteration over download.py
1 parent 88630be commit 464ec4f

File tree

8 files changed

+298
-148
lines changed

8 files changed

+298
-148
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ Options:
183183
e.g. https://databus.dbpedia.org/sparql)
184184
--vault-token TEXT Path to Vault refresh token file
185185
--databus-key TEXT Databus API key to download from protected databus
186+
--latest-only When downloading artifacts, only download the latest
187+
version
186188
--authurl TEXT Keycloak token endpoint URL [default:
187189
https://auth.dbpedia.org/realms/dbpedia/protocol/openid-
188190
connect/token]

databusclient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from databusclient import cli
2-
from databusclient.client import create_dataset, deploy, create_distribution
2+
from databusclient.api.deploy import create_dataset, deploy, create_distribution
33

44
__all__ = ["create_dataset", "deploy", "create_distribution"]
55

databusclient/api/delete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import requests
33
from typing import List
44

5-
from databusclient.api.utils import get_databus_id_parts_from_uri, get_json_ld_from_databus
5+
from databusclient.api.utils import get_databus_id_parts_from_uri, fetch_databus_jsonld
66

77
def _confirm_delete(databusURI: str) -> str:
88
"""
@@ -97,7 +97,7 @@ def _delete_artifact(databusURI: str, databus_key: str, dry_run: bool = False, f
9797
- databus_key: Databus API key to authenticate the deletion requests
9898
- dry_run: If True, do not perform the deletion but only print what would be deleted
9999
"""
100-
artifact_body = get_json_ld_from_databus(databusURI, databus_key)
100+
artifact_body = fetch_databus_jsonld(databusURI, databus_key)
101101

102102
json_dict = json.loads(artifact_body)
103103
versions = json_dict.get("databus:hasVersion")
@@ -133,7 +133,7 @@ def _delete_group(databusURI: str, databus_key: str, dry_run: bool = False, forc
133133
- databus_key: Databus API key to authenticate the deletion requests
134134
- dry_run: If True, do not perform the deletion but only print what would be deleted
135135
"""
136-
group_body = get_json_ld_from_databus(databusURI, databus_key)
136+
group_body = fetch_databus_jsonld(databusURI, databus_key)
137137

138138
json_dict = json.loads(group_body)
139139
artifacts = json_dict.get("databus:hasArtifact", [])

0 commit comments

Comments
 (0)