Skip to content

Commit 413a6a3

Browse files
committed
added figshare link to dataset.yml and switched downloader to read url from there
1 parent d355585 commit 413a6a3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

coderdata/dataset.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
figshare: "https://api.figshare.com/v2/articles/26409316"
12
version: "v0.1.4"
23
datasets:
34
beataml:

coderdata/download/downloader.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# coderdata/download/downloader.py
22

3+
from importlib import resources
34
from pathlib import Path
45
from os import PathLike
56
import os
67
import requests
78
import warnings
89

10+
import yaml
11+
912
def download(
1013
name: str=None,
1114
local_path: PathLike=Path.cwd(),
@@ -44,7 +47,9 @@ def download(
4447
if not local_path.exists():
4548
Path.mkdir(local_path)
4649
# Get the dataset details
47-
url = "https://api.figshare.com/v2/articles/25033697"
50+
with resources.open_text('coderdata', 'dataset.yml') as f:
51+
data_information = yaml.load(f, Loader=yaml.FullLoader)
52+
url = data_information['figshare']
4853

4954
response = requests.get(url)
5055
if response.status_code != 200:

0 commit comments

Comments
 (0)