Development repo for API integration between LibCal and Passage Point
libcal_requests.py
, which contains the LibCalRequests
class.
config.yml
, which should reside in the same directory as the module.)__init__
method gets a new auth token (using the supplied paramters in the config.)retrieve_bookings
method fetches the day's current bookings for the locations specified in the config.alma_requests.py
, which contains the AlmaRequests
class.
LibCalRequests
.main
method a Python list
of Alma Primary ID's (GWID numbers) to return the users' barcodes. Failed matches will be omitted from the returned results.sqlite_cache.py
, which contains the SQLiteCache
class.
users
and appts
tables.add_user
accepts a list of dictionaries of the following structure:
{'primary_id': 'GXXXXXXXX', 'barcode': '2282XXXXXXXXX', 'visitor_id': 'sdfjh3'}
where visitor_id
corresponds to the id
returned by the createVistor
endpoint of the PassagePoint API, and the other values are from Alma.lookup_user
queries the database for a provided primary_id
and returns the user's other identifiers (if found).add_appt
accepts a single Python dictionary of the following structure:
{'appt_id': 'yt54884', 'prereg_id': '343234jf'}
where appt_id
corresponds to the bookId
from the LibCal API, and prereg_id
corresponds to the id
returned by the createPreReg
endpoint in PassagePoint.lookup_appt
queries the database for a single provided appt_id
(LibCal's bookId
) and returns the mapping to the PassagePoint ID.app.py
, which contains the LibCal2PP
class.
__init__
creates instances of the AlmaRequests
, LibCalRequests
, and SQLiteCache
classes.log_new_bookings
does the following:
process_users
to obtain the PassagePoint VisitorId's.PassagePointRequests
to create each pre-reg.process_users
does the following:
register_new_users
to create the PassagePoint accounts.register_new_users
does the following:
PassagePointRequests
to create a new user account and return the VisitorId for each new user.LibCalRequests
is currently written to do so on init).app.py
to run the process at specified intervals.