-
Notifications
You must be signed in to change notification settings - Fork 19
feat(importer): added new gobi importer #1116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kpsherva
merged 1 commit into
CERNDocumentServer:master
from
callumlewis05:new-importer-provider
Aug 31, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = { | ||
| "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", | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.""" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.