corrlib/corrlib/trackers/datalad.py

25 lines
601 B
Python

import datalad.api as dl
import os
from typing import Optional
def get(path: str, file: str) -> None:
if file == "backlogger.db":
print("Downloading database...")
else:
print("Downloading data...")
dl.get(os.path.join(path, file), dataset=path)
print("> downloaded file")
return
def save(path: str, message: str, files: Optional[list[str]]=None) -> None:
if files is not None:
files = [os.path.join(path, f) for f in files]
dl.save(files, message=message, dataset=path)
return
def create(path: str) -> None:
dl.create(path)
return