Skip to content

berick/pysip2

Repository files navigation

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

About

Python3 SIP2 Library

Resources

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE.txt
Unknown
COPYING.TXT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages