Skip to main content

ZenodoDatasetSource

DatasetSource
DashAI.back.dataset_sources.ZenodoDatasetSource

Dataset source that fetches public datasets from Zenodo.

Uses the Zenodo REST API — no authentication required for public records. Pagination is page-based; the cursor encodes the current page number as a string.

Methods

download_dataset(self, dataset_id: str, temp_path: str) -> str

Defined on ZenodoDatasetSource

Download all files for a Zenodo record into a local directory.

Parameters

dataset_id : str
Zenodo record ID (integer as string, e.g. "123456").
temp_path : str
Local directory to download into.

Returns

str
Path to the directory containing the downloaded files.

get_info(self, dataset_id: str) -> DashAI.back.dataset_sources.base_dataset_source.DatasetEntry | None

Defined on ZenodoDatasetSource

Return full metadata for a single Zenodo record.

Parameters

dataset_id : str
Zenodo record ID (integer as string, e.g. "123456").

Returns

DatasetEntry or None
Full metadata entry, or None on error.

search(self, query: str, limit: int = 20, cursor: str | None = None, **filters: Any) -> DashAI.back.dataset_sources.base_dataset_source.SearchPage

Defined on ZenodoDatasetSource

Return public Zenodo datasets matching a query.

Parameters

query : str
Free-text search string.
limit : int, optional
Maximum number of results per page, by default 20.
cursor : str or None, optional
Opaque pagination token (encodes the page number as a string). Pass None to fetch the first page.
**filters : Any
Unused; reserved for future filters.

Returns

SearchPage
Matching datasets and cursor for the next page (or None).

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.