Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cds_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ def query_params_modifier(extra_params):
},
"ebl": {"priority": 4, "agency_code": "MiAaPQ"},
"safari": {"priority": 4, "agency_code": "OCoLC"},
"gobi": {"priority": 4, "agency_code": "YBPUID"},
}

CDS_ILS_IMPORTER_UPLOADS_PATH = "/tmp"
Expand Down
8 changes: 8 additions & 0 deletions cds_ils/importer/providers/gobi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

"""CDS-ILS Gobi Importer module."""
36 changes: 36 additions & 0 deletions cds_ils/importer/providers/gobi/gobi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""CDS-ILS GOBI model."""
from copy import deepcopy

from cds_ils.importer.base_model import Base
from cds_ils.importer.base_model import model as model_base
from cds_ils.importer.providers.gobi.ignore_fields import GOBI_IGNORE_FIELDS


class GOBIDocument(Base):
"""GOBI model for XML mapping."""

__query__ = "003:YBPUID"

__ignore_keys__ = GOBI_IGNORE_FIELDS

_default_fields = {"document_type": "BOOK", "languages": ["ENG"]}

def do(
self,
blob,
ignore_missing=True,
exception_handlers=None,
init_fields=None,
):
"""Overwrite the do method."""
init_fields = deepcopy(self._default_fields)
return super().do(blob, ignore_missing, exception_handlers, init_fields)


model = GOBIDocument(bases=(model_base,), entry_point_group="cds_ils.importer.document")
42 changes: 42 additions & 0 deletions cds_ils/importer/providers/gobi/ignore_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.
"""CDS-ILS Gobi Importer ignore fields."""
GOBI_IGNORE_FIELDS = {
Comment thread
kpsherva marked this conversation as resolved.
"005",
"006",
"007",
"008",
"020__q",
"020__z",
"040__a",
"040__c",
"043__a",
"050_4b",
"082042",
"1001_d",
"24510c",
"336__2",
"336__a",
"336__b",
"337__2",
"337__a",
"337__b",
"338__2",
"338__a",
"338__b",
"504__a",
"533__a",
"533__b",
"533__n",
"588__a",
"5880_a",
"650_0x",
"650_0z",
"7102_a",
"77608c",
"77608w",
}
17 changes: 17 additions & 0 deletions cds_ils/importer/providers/gobi/importer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

"""CDS-ILS Gobi Importer module."""

from cds_ils.importer.importer import Importer


class GOBIImporter(Importer):
"""Importer class for GOBI."""

EITEM_OPEN_ACCESS = False
EITEM_URLS_LOGIN_REQUIRED = True
8 changes: 8 additions & 0 deletions cds_ils/importer/providers/gobi/rules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# CDS-ILS is free software; you can redistribute it and/or modify it under
# the terms of the MIT License; see LICENSE file for more details.

"""CDS-ILS GOBI Importer rules."""
Loading
Loading