Skip to content
Python3 SIP2 Library
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src/pysip2
.gitignore
COPYING.TXT
LICENSE.txt
README.asciidoc
pysip2-client.ini.example

README.asciidoc

Python3 SIP2 Client Library

Running Example Code

$ cp pysip2-client.ini.example pysip2-client.ini
  • Modify the [client] section of pysip2-client.ini to point it at your SIP2 server.

$ PYTHONPATH=src examples/sc-status.py
$ PYTHONPATH=src examples/item-info-request.py <item_barcode>
$ PYTHONPATH=src examples/checkout.py <item_barcode> <patron_barcode>
$ PYTHONPATH=src examples/checkin.py <item_barcode>
# ...
  • There is also a SIP shell for manually entering commands and seeing message responses. The shell will look for a pysip2-client.ini in the working directory. If found, it will be used to initialize the shell. Otherwise, all connection values must be manually entered into the shell.

$ PYTHONPATH=src python3 src/pysip2/shell.py
sipsh% server
my-sip-server1.example.org
sipsh% server my-sip-server2.example.org
Set SIP attribute "server" to "my-sip-server2.example.org"
sipsh% username sip-username
Set SIP attribute "username" to "sip-username"
sipsh% password sip-password
Set SIP attribute "password" to "sip-password"
sipsh% start
Connect OK
Login OK
Server is online
sipsh% patron-status 123456789
Label                           : Patron Status Response
Code                            : 24
patron status                   :   Y
language                        : 000
transaction date                : 20170913    092221
[AE] personal name              : JANE Q PATRON
[AA] patron identifier          : 123456789
[BL] valid patron               : Y
[CQ] valid patron password      : N
[BH] currency type              : USD
[AO] institution id             : my-institution
sipsh% help
Commands:
  help
    - Display help message
  echo
    - Echo command with arguments
...

TODO

  • checksums

  • hold message + response

  • renew message + response

  • renew all message + response

You can’t perform that action at this time.