# -*- coding: utf-8 -*-
"""Align N2T with the Bioregistry."""
from typing import Mapping, Sequence
from bioregistry.align.utils import Aligner
from bioregistry.external.n2t import get_n2t
[docs]class N2TAligner(Aligner):
"""Aligner for the N2T."""
key = "n2t"
getter = get_n2t
curation_header = ("name", "homepage", "description")
[docs] def get_skip(self) -> Mapping[str, str]:
"""Get the prefixes in N2T that should be skipped."""
return {
"zzztestprefix": "test prefix should not be considered",
}
[docs] def get_curation_row(self, external_id, external_entry) -> Sequence[str]:
"""Prepare curation rows for unaligned BioPortal registry entries."""
return [
external_entry["name"].strip(),
external_entry.get("homepage", "").strip(),
external_entry.get("description", "").strip(),
]
if __name__ == "__main__":
N2TAligner.align()