diff --git a/src/bibapi/__init__.py b/src/bibapi/__init__.py index 0dded92..7f3f30a 100644 --- a/src/bibapi/__init__.py +++ b/src/bibapi/__init__.py @@ -1,5 +1,4 @@ -from enum import Enum - +from .schemas.api_types import * from .sru import Api as _Api __all__ = [ @@ -12,86 +11,6 @@ __all__ = [ ] -class PicaSchema(Enum): - TITLE = "pica.tit" - CALLSIGN = "pica.abr" - ALL = "pica.all" - DATE_FIRST_CREATION = "pica.ser" - DATE_LAST_MODIFIED = "pica.aed" - ISBN = "pica.isb" - ISSN = "pica.isn" - ISMN = "pica.ism" - PPN = "pica.ppn" - AUTHOR = "pica.per" - YEAR = "pica.jhr" - AUTHOR_SCHEMA = "NoSpaceAfterComma" - ENCLOSE_TITLE_IN_QUOTES = False - - -class ALMASchema(Enum): - TITLE = "alma.title" - AUTHOR = "alma.author" - ENCLOSE_TITLE_IN_QUOTES = True - AUTHOR_SCHEMA = "NoSpaceAfterComma" - YEAR = "date_of_publication" - - -class DublinCoreSchema(Enum): - TITLE = "dc.title" - AUTHOR = "dc.creator" - AUTHOR_SCHEMA = "SpaceAfterComma" - ENCLOSE_TITLE_IN_QUOTES = False - YEAR = "dc.date" - - -class CQLSchema(Enum): - pass - - -class SWBSchema(Enum): - URL = "https://sru.k10plus.de/opac-de-627!rec=1?version=1.1&operation=searchRetrieve&query={}&maximumRecords=100&recordSchema=marcxml" - ARGSCHEMA = PicaSchema - NAME = "SWB" - LIBRARY_NAME_LOCATION_FIELD = "924$b" - - -class DNBSchema(Enum): - URL = "https://services.dnb.de/sru/dnb?version=1.1&operation=searchRetrieve&query={}&maximumRecords=100&recordSchema=MARC21-xml" - ARGSCHEMA = DublinCoreSchema - NAME = "DNB" - - -class KOBVSchema(Enum): - URL = "https://sru.kobv.de/k2?version=1.1&operation=searchRetrieve&query={}&startRecord=1&maximumRecords=100&recordSchema=marcxml" - ARGSCHEMA = DublinCoreSchema - NAME = "KOBV" - LIBRARY_NAME_LOCATION_FIELD = "924$b" - - -class HebisSchema(Enum): - URL = "http://sru.hebis.de/sru/DB=2.1?query={}&version=1.1&operation=searchRetrieve&stylesheet=http%3A%2F%2Fsru.hebis.de%2Fsru%2F%3Fxsl%3DsearchRetrieveResponse&recordSchema=marc21&maximumRecords=100&startRecord=1&recordPacking=xml&sortKeys=LST_Y%2Cpica%2C0%2C%2C" - ARGSCHEMA = PicaSchema - NOTSUPPORTEDARGS = ["YEAR"] - NAME = "HEBIS" - REPLACE = {" ": "+", "&": "%26", "=": "+%3D+"} - LIBRARY_NAME_LOCATION_FIELD = "924$b" - - -class OEVKSchema(Enum): - URL = "https://sru.k10plus.de/opac-de-627-2?version=1.1&operation=searchRetrieve&query={}&maximumRecords=100&recordSchema=marcxml" - ARGSCHEMA = PicaSchema - NAME = "OEVK" - LIBRARY_NAME_LOCATION_FIELD = "924$b" - - -class HBZSchema(Enum): - URL = "https://eu04.alma.exlibrisgroup.com/view/sru/49HBZ_NETWORK?version=1.2&operation=searchRetrieve&recordSchema=marcxml&query={}&maximumRecords=100&recordSchema=marcxml" - ARGSCHEMA = ALMASchema - NAME = "HBZ" - LIBRARY_NAME_LOCATION_FIELD = "852$a" - NOTSUPPORTEDARGS = ["PPN"] - - class SWB(_Api): def __init__(self): self.site = SWBSchema.NAME.value