diff --git a/corrlib/data_backend/databackend.py b/corrlib/data_backend/databackend.py new file mode 100644 index 0000000..dad9fee --- /dev/null +++ b/corrlib/data_backend/databackend.py @@ -0,0 +1,7 @@ +import .datalad as dl + + +class DataBackend: + @abstractmethod + def get_file(self, data, file): + pass \ No newline at end of file diff --git a/corrlib/data_backend/datalad.py b/corrlib/data_backend/datalad.py new file mode 100644 index 0000000..9ccf1a6 --- /dev/null +++ b/corrlib/data_backend/datalad.py @@ -0,0 +1,13 @@ +import datalad.api as dl +import os +from corrlib.data_backend.databackend import + +def DLBackend() + +def get_file(path, file): + if file == "backlogger.db": + print("Downloading database...") + else: + print("Downloading data...") + dl.get(os.path.join(path, file), dataset=path) + print("> downloaded file") \ No newline at end of file diff --git a/corrlib/tools.py b/corrlib/tools.py index 14bfc05..6bc8b27 100644 --- a/corrlib/tools.py +++ b/corrlib/tools.py @@ -17,13 +17,4 @@ def m2k(m): def k2m(k): return (1/(2*k))-4 - - -def get_file(path, file): - if file == "backlogger.db": - print("Downloading database...") - else: - print("Downloading data...") - dl.get(os.path.join(path, file), dataset=path) - print("> downloaded file") \ No newline at end of file