Skip to content

Commit

Permalink
Merge branch 'main' into data_europa_eu
Browse files Browse the repository at this point in the history
  • Loading branch information
J535D165 authored Sep 29, 2024
2 parents 42a8d13 + 6ca501b commit a0e8101
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repos:
"mkdocs.yml"
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
rev: v0.6.7
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 2 additions & 0 deletions datahugger/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from datahugger.services import MendeleyDataset
from datahugger.services import OSFDataset
from datahugger.services import PangaeaDataset
from datahugger.services import SeaNoeDataset
from datahugger.services import ZenodoDataset

# fast lookup
Expand Down Expand Up @@ -113,6 +114,7 @@
"researchdata.ntu.edu.sg": DataverseDataset,
"rin.lipi.go.id": DataverseDataset,
"ssri.is": DataverseDataset,
"www.seanoe.org": SeaNoeDataset,
"trolling.uit.no": DataverseDataset,
"www.sodha.be": DataverseDataset,
"www.uni-hildesheim.de": DataverseDataset,
Expand Down
20 changes: 20 additions & 0 deletions datahugger/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,3 +405,23 @@ class DataEuropaDataset(DatasetDownloader):
ATTR_FILE_LINK_JSONPATH = "'dcat:accessURL'.@id"
ATTR_NAME_JSONPATH = "'dct:title'"
ATTR_SIZE_JSONPATH = "'dcat:byteSize'.@value"


class SeaNoeDataset(DatasetDownloader):
"""Downloader for SeaNoe publication."""

REGEXP_ID = r"https://www.seanoe\.org/data/[0-9]+/(?P<record_id>.*)/"

# the base entry point of the REST API
API_URL = "https://www.seanoe.org/api/"

# the files and metadata about the dataset
API_URL_META = "{api_url}find-by-id/{record_id}"
META_FILES_JSONPATH = "files[*]"

# paths to file attributes
ATTR_NAME_JSONPATH = "fileName"
ATTR_FILE_LINK_JSONPATH = "fileUrl"
ATTR_SIZE_JSONPATH = "size"
ATTR_HASH_JSONPATH = "checksum"
ATTR_HASH_TYPE_VALUE = "sha256"
4 changes: 4 additions & 0 deletions tests/test_repositories.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ files = "cbsodata-main/README.md"
[[dataeuropa]]
location = "https://data.europa.eu/data/datasets/65e092e4009f18f050b14216"
files = "consolidation-wattzhub-schema-irve-dynamic-20240918-033000.csv"

[[seanoe]]
location = "https://doi.org/10.17882/101042"
files = "111609.xlsx"

0 comments on commit a0e8101

Please sign in to comment.