API Docs¶
Flask extension for Invenio-SIP2.
-
class
invenio_sip2.ext.
InvenioSIP2
(app=None)[source]¶ Invenio-SIP2 extension.
Extension initialization.
-
sip2_current_date
¶ Get current date from system.
-
sip2_language
¶ Get default language from system.
-
Actions¶
Invenio-SIP2 custom actions.
-
class
invenio_sip2.actions.actions.
AutomatedCirculationSystemStatus
(command, response, message, **kwargs)[source]¶ Action to get status from automated circulation system.
Init action object.
-
class
invenio_sip2.actions.actions.
BlockPatron
(command, response, message, **kwargs)[source]¶ Action to block patron.
Init action object.
-
class
invenio_sip2.actions.actions.
Checkin
(command, response, message, **kwargs)[source]¶ Action to checkin an item.
Init action object.
-
class
invenio_sip2.actions.actions.
Checkout
(command, response, message, **kwargs)[source]¶ Action to checkout an item.
Init action object.
-
class
invenio_sip2.actions.actions.
EndPatronSession
(command, response, message, **kwargs)[source]¶ Action to end patron session on automated circulation system.
Init action object.
-
class
invenio_sip2.actions.actions.
FeePaid
(command, response, message, **kwargs)[source]¶ Action to paid fee.
Init action object.
-
class
invenio_sip2.actions.actions.
Hold
(command, response, message, **kwargs)[source]¶ Action to hold an item.
Init action object.
-
class
invenio_sip2.actions.actions.
ItemInformation
(command, response, message, **kwargs)[source]¶ Action to get item information from automated circulation system.
Init action object.
-
class
invenio_sip2.actions.actions.
ItemStatusUpdate
(command, response, message, **kwargs)[source]¶ Action to update item status.
Init action object.
-
class
invenio_sip2.actions.actions.
PatronEnable
(command, response, message, **kwargs)[source]¶ Action to enable patron on automated circulation system.
Init action object.
-
class
invenio_sip2.actions.actions.
PatronInformation
(command, response, message, **kwargs)[source]¶ Action to get patron information from automated circulation system.
Init action object.
-
class
invenio_sip2.actions.actions.
PatronStatus
(command, response, message, **kwargs)[source]¶ Action to get patron status from automated circulation system.
Init action object.
-
class
invenio_sip2.actions.actions.
Renew
(command, response, message, **kwargs)[source]¶ Action to renew an item.
Init action object.
-
class
invenio_sip2.actions.actions.
RenewAll
(command, response, message, **kwargs)[source]¶ Action to renew all items.
Init action object.
-
class
invenio_sip2.actions.actions.
RequestResend
(command, message)[source]¶ Action to resend last message.
Init action object.
Records API¶
API for manipulating the client.
-
class
invenio_sip2.records.record.
Client
(data, **kwargs)[source]¶ class for selfcheck client.
Initialize instance with dictionary data.
Parameters: data – Dict with record metadata. -
institution_id
¶ Shortcut to institution id.
-
is_authenticated
¶ Shortcut to check if the selfcheck client is authenticated.
-
last_request_message
¶ Shortcut to user id.
-
last_response_message
¶ Shortcut to user id.
-
last_sequence_number
¶ Shortcut to user id.
-
library_language
¶ Shortcut for library language.
-
library_name
¶ Shortcut to library name.
-
remote_app
¶ Shortcut for remote app.
-
server_id
¶ Get server identifier.
-
terminal
¶ Shortcut to terminal.
-
transaction_user_id
¶ Shortcut to user id.
-
-
class
invenio_sip2.records.record.
Server
(data, **kwargs)[source]¶ class for SIP2 server.
Initialize instance with dictionary data.
Parameters: data – Dict with record metadata. -
classmethod
create
(data, id_=None, **kwargs)[source]¶ Create record.
Parameters: - data – Dict with metadata.
- id – Specify a UUID to use for the new record.
-
is_running
¶ Check if server is running.
-
number_of_clients
¶ Shortcut for number of clients.
-
classmethod
-
class
invenio_sip2.records.record.
Sip2RecordMetadata
(data, **kwargs)[source]¶ Sip2RecordMetadata class.
Initialize instance with dictionary data.
Parameters: data – Dict with record metadata. -
classmethod
create
(data, id_=None, **kwargs)[source]¶ Create record.
Parameters: - data – Dict with metadata.
- id – Specify a UUID to use for the new record.
-
id
¶ Shortcut for id.
-
classmethod
Models¶
Models for Invenio-SIP2.
-
class
invenio_sip2.models.
PatronStatusTypes
[source]¶ Enum class to list all possible patron status types.
-
CARD_REPORTED_LOST
= 'card_reported_lost'¶
-
CHARGE_PRIVILEGES_DENIED
= 'charge_privileges_denied'¶
-
EXCESSIVE_OUTSTANDING_FEES
= 'excessive_outstanding_fees'¶
-
EXCESSIVE_OUTSTANDING_FINES
= 'excessive_outstanding_fines'¶
-
HOLD_PRIVILEGES_DENIED
= 'hold_privileges_denied'¶
-
RECALL_OVERDUE
= 'recall_overdue'¶
-
RECALL_PRIVILEGES_DENIED
= 'recall_privileges_denied'¶
-
RENEWAL_PRIVILEGES_DENIED
= 'renewal_privileges_denied'¶
-
TOO_MANY_CLAIMS_OF_ITEMS_RETURNED
= 'too_many_claims_of_items_returned'¶
-
TOO_MANY_ITEMS_BILLED
= 'too_many_items_billed'¶
-
TOO_MANY_ITEMS_CHARGED
= 'too_many_items_charged'¶
-
TOO_MANY_ITEMS_LOST
= 'too_many_items_lost'¶
-
TOO_MANY_ITEMS_OVERDUE
= 'too_many_items_overdue'¶
-
TOO_MANY_RENEWALS
= 'too_many_renewals'¶
-
-
class
invenio_sip2.models.
SelfcheckCheckin
(permanent_location, checkin=False, alert=False, magnetic_media='unknown', resensitize='unknown', **kwargs)[source]¶ Class representing checkin handler response.
Constructor.
:param permanent_location - permanent_location of the item :param checkin - checkin operation is success or not :param alert - indicate if the selcheck will generate sound alert :param magnetic_media - indicate the presence of magnetic media :param resensitize - resensitize an item ? :param kwargs - optional fields
-
has_magnetic_media
¶ Shortcut for desensitize.
-
is_success
¶ Shortcut for checkin.
-
resensitize
¶ Shortcut for resensitize.
-
sound_alert
¶ Shortcut for alert.
-
-
class
invenio_sip2.models.
SelfcheckCheckout
(title_id, checkout=False, renewal=False, magnetic_media='unknown', desensitize='unknown', **kwargs)[source]¶ Class representing checkout handler response.
Constructor.
:param title_id - title_id (e.g. title, identifier, …) :param checkout - checkout operation is success or not :param renewal - renewal operation is success or not :param magnetic_media - indicate the presence of magnetic media :param desensitize - desensitize an item ? :param kwargs - optional fields
-
desensitize
¶ Shortcut for desensitize.
-
due_date
¶ Shortcut for due date.
-
has_magnetic_media
¶ Shortcut for desensitize.
-
is_renewal
¶ Shortcut for renewal ok.
-
is_success
¶ Shortcut for checkout ok.
-
-
class
invenio_sip2.models.
SelfcheckCirculationStatus
[source]¶ Class to handle all available circulation status of an item.
-
AVAILABLE
= '03'¶
-
CHARGED
= '04'¶
-
CHARGED_RECALL
= '05'¶
-
CLAIMED_RETURNED
= '11'¶
-
IN_PROCESS
= '06'¶
-
IN_TRANSIT
= '10'¶
-
LOST
= '12'¶
-
MISSING
= '13'¶
-
ON_ORDER
= '02'¶
-
OTHER
= '01'¶
-
RECALLED
= '07'¶
-
WAITING_ON_HOLD_SHELF
= '08'¶
-
WAITING_TO_RESHELF
= '09'¶
-
-
class
invenio_sip2.models.
SelfcheckEnablePatron
(patron_id, institution_id, patron_name='', patron_status=None, language='und', **kwargs)[source]¶ Class representing patron information handler response.
Constructor.
:param patron_id - patron identifier (e.g. id, barcode, …) :param institution_id - institution id (or code) of the patron :param patron_name - full name of the patron :param patron_status - status of the patron :param language - iso-639-2 language :param kwargs - optional fields
-
class
invenio_sip2.models.
SelfcheckFeePaid
(accepted=False, **kwargs)[source]¶ Class representing fee paid handler response.
Constructor.
Parameters: - accepted – payment operation is accepted or not should be set to True if the ACS accept the payment. should be set to 0 if the ACS did not accept the payment.
- kwargs – optional fields
-
is_accepted
¶ Shortcut for payment_accepted operation.
-
class
invenio_sip2.models.
SelfcheckFeeType
[source]¶ Class to handle all available fee type.
-
ADMINISTRATIVE
= '02'¶
-
COMPUTER_ACCESS_CHARGE
= '08'¶
-
DAMAGE
= '03'¶
-
HOLD_FEE
= '09'¶
-
OTHER
= '01'¶
-
OVERDUE
= '04'¶
-
PROCESSING
= '05'¶
-
RENTAL
= '06'¶
-
REPLACEMENT
= '07'¶
-
-
class
invenio_sip2.models.
SelfcheckHold
(hold=False, available=False, **kwargs)[source]¶ Class representing hold handler response.
Constructor.
:param hold - hold operation is success or not :param available - item available or not :param kwargs - optional fields
-
is_available
¶ Shortcut for available.
-
is_success
¶ Shortcut for hold ok.
-
-
class
invenio_sip2.models.
SelfcheckItemInformation
(item_id, title_id=None, circulation_status=None, fee_type=None, security_marker=None, **kwargs)[source]¶ Class representing item information handler response.
Constructor.
:param patron_id - patron identifier (e.g. id, barcode, …) :param patron_name - full name of the patron :param institution_id - institution id (or code) of the patron :param language - iso-639-2 language :param kwargs - optional fields
-
class
invenio_sip2.models.
SelfcheckLanguage
[source]¶ Enum class to list all available language.
-
ARABIC
= '016'¶
-
BELGIAN
= '026'¶
-
CANADIAN_FRENCH
= '011'¶
-
CHINESE
= '019'¶
-
DANISH
= '009'¶
-
DUTCH
= '005'¶
-
ENGLISH
= '001'¶
-
FINNISH
= '007'¶
-
FRENCH
= '002'¶
-
GERMAN
= '003'¶
-
GREEK
= '018'¶
-
HEBREW
= '013'¶
-
ICELANDIC
= '025'¶
-
ITALIAN
= '004'¶
-
JAPANESE
= '014'¶
-
KOREAN
= '020'¶
-
MALAY
= '023'¶
-
NORTH_AMERICAN_SPANISH
= '021'¶
-
NORWEGIAN
= '012'¶
-
POLISH
= '017'¶
-
PORTUGUESE
= '010'¶
-
RUSSIAN
= '015'¶
-
SPANISH
= '008'¶
-
SWEDISH
= '006'¶
-
TAIWANESE
= '027'¶
-
TAMIL
= '022'¶
-
UNITED_KINGDOM
= '024'¶
-
UNKNOWN
= '000'¶
-
chi
= '019'¶
-
dan
= '009'¶
-
dut
= '005'¶
-
eng
= '001'¶
-
fin
= '007'¶
-
fra
= '002'¶
-
fre
= '002'¶
-
ger
= '003'¶
-
gre
= '018'¶
-
heb
= '013'¶
-
ice
= '025'¶
-
isl
= '025'¶
-
ita
= '004'¶
-
jpn
= '014'¶
-
kor
= '020'¶
-
may
= '023'¶
-
msa
= '023'¶
-
nor
= '012'¶
-
pol
= '017'¶
-
por
= '010'¶
-
rus
= '015'¶
-
spa
= '008'¶
-
swe
= '006'¶
-
tam
= '022'¶
-
und
= '000'¶
-
zho
= '019'¶
-
-
class
invenio_sip2.models.
SelfcheckMediaType
[source]¶ Class to handle all available media type.
-
AUDIO
= '004'¶
-
BOOK
= '001'¶
-
BOOK_WHIT_AUDIO_TAPE
= '010'¶
-
BOOK_WHIT_CD
= '009'¶
-
BOOK_WHIT_DISKETTE
= '008'¶
-
BOUND_JOURNAL
= '003'¶
-
CD_OR_CDROM
= '006'¶
-
DISKETTE
= '007'¶
-
MAGAZINE
= '002'¶
-
OTHER
= '000'¶
-
VIDEO
= '005'¶
-
-
class
invenio_sip2.models.
SelfcheckPatronInformation
(patron_id, institution_id, patron_name='', patron_status=None, language='und', **kwargs)[source]¶ Class representing patron information handler response.
Constructor.
:param patron_id - patron identifier (e.g. id, barcode, …) :param institution_id - institution id (or code) of the patron :param patron_name - full name of the patron :param patron_status - status of the patron :param language - iso-639-2 language :param kwargs - optional fields
-
charged_items_count
¶ Shortcut for charged items count.
-
fine_items_count
¶ Shortcut for fine items count.
-
hold_items_count
¶ Shortcut for hold items count.
-
overdue_items_count
¶ Shortcut for overdue items count.
-
patron_id
¶ Shortcut for patron pid.
-
patron_name
¶ Shortcut for patron pid.
-
recall_items_count
¶ Shortcut for recall items count.
Shortcut for unavailable items count.
-
-
class
invenio_sip2.models.
SelfcheckPatronStatus
(patron_id, institution_id, patron_name='', patron_status=None, language='und', **kwargs)[source]¶ Class representing patron information handler response.
Constructor.
:param patron_id - patron identifier (e.g. id, barcode, …) :param institution_id - institution id (or code) of the patron :param patron_name - full name of the patron :param patron_status - status of the patron :param language - iso-639-2 language :param kwargs - optional fields
-
class
invenio_sip2.models.
SelfcheckPaymentType
[source]¶ Class to handle all available payment type.
-
CASH
= '00'¶
-
CREDIT_CARD
= '02'¶
-
VISA
= '01'¶
-
-
class
invenio_sip2.models.
SelfcheckRenew
(title_id, success=False, renewal=False, magnetic_media='unknown', desensitize='unknown', **kwargs)[source]¶ Class representing renew handler response.
Constructor.
Parameters: - title_id – title_id (e.g. title, identifier, …)
- renew – renew operation is success or not should be set to True if the ACS renew the item. should be set to 0 if the ACS did not renew the item.
- renewal – renewal operation. should be set to True if the patron requesting to renew the item already has the item renewed. should be set to False if the item is not already renewed.
- magnetic_media – indicate the presence of magnetic media
- desensitize – desensitize an item ?
- kwargs – optional fields
-
desensitize
¶ Shortcut for desensitize.
-
due_date
¶ Shortcut for due date.
-
has_magnetic_media
¶ Shortcut for desensitize.
-
is_renewal
¶ Shortcut for renewal ok.
-
is_success
¶ Shortcut for success operation.
-
class
invenio_sip2.models.
SelfcheckSecurityMarkerType
[source]¶ Class to handle all available security marker type.
-
NONE
= '01'¶
-
OTHER
= '00'¶
-
TATTLE_TAPE_SECURITY_STRIP
= '02'¶
-
WHISPHER_TAPE
= '03'¶
-
-
class
invenio_sip2.models.
SelfcheckSummary
(text)[source]¶ Class representing summary.
Init.
-
fields
= ['hold_items', 'overdue_items', 'charged_items', 'fine_items', 'recall_items', 'unavailable_hold_items']¶
-
-
class
invenio_sip2.models.
SupportedMessages
[source]¶ Class to define supported mesages from handler config.
Constructor.
-
handlers
= ['patron_status', 'checkout', 'checkin', 'block_patron', 'system_status', 'request_resend', 'login', 'account', 'end_patron_session', 'fee_paid', 'item', 'item_status_update', 'enable_patron', 'hold', 'renew', 'renew_all']¶
-