Package: almapipy
almapipy: Python Wrapper for Alma APIalmapipy is python requests wrapper for easily accessing the Ex Libris Alma API. It is designed to be lightweight, and imposes a structure that mimics theAlma API architecture.Installationpip install almapipyProgress and RoadmapGet functionality has been developed around all the Alma APIs (listed below).
Post, Put and Delete functions will be gradually added in future releases.APIGetPostPutDeletebibsXanalyticsXNANANAacquisitionsXconfigurationXcoursesXresource sharing partnersXtask-listsXusersXelectronicXUseImport# Import and call primary Client classfromalmapipyimportAlmaCnxnalma=AlmaCnxn('your_api_key',data_format='json')Access Bibliographic DataAlma provides a set of Web services for handling bibliographic records related information, enabling you to quickly and easily manipulate bibliographic records related details. These Web services can be used by external systems to retrieve or update bibliographic records related data.# Use Alma mms_id for retrieving bib recordsharry_potter="9980963346303126"bib_record=alma.bibs.catalog.get(harry_potter)# get holding items for a bib recordholdings=alma.bibs.catalog.get_holdings(harry_potter)# get loans by titleloans=alma.bibs.loans.get_by_title(harry_potter)# or by a specific holding itemloans=alma.bibs.loans.get_by_item(harry_potter,holding_id,item_id)# get requests or availability of bibalma.bibs.requests.get_by_title(harry_potter)alma.bibs.requests.get_by_item(harry_potter,holding_id,item_id)alma.bibs.requests.get_availability(harry_potter,period=20)# get digital representationsalma.bibs.representations.get(harry_potter)# get linked dataalma.bibs.linked_data.get(harry_potter)Access ReportsThe Analytics API returns an Alma report.# Find the system path to the report if don't know pathalma.analytics.paths.get('/shared')# retrieve the report as an XML ET element (native response)report=alma.analytics.reports.get('path_to_report')# or convert the xml to json after API callreport=alma.analytics.reports.get('path_to_report',return_json=True)Access CoursesAlma provides a set of Web services for handling courses and reading lists related information, enabling you to quickly and easily manipulate their details. These Web services can be used by external systems such as Courses Management Systems to retrieve or update courses and reading lists related data.# Get a complete list of courses. Makes multiple calls if necessary.course_list=alma.courses.get(all_records=True)# or filter on search parametersecon_courses=alma.courses.get(query={'code':'ECN'})# get reading lists for a coursecourse_id=econ_courses['course'][0]['id']reading_lists=alma.courses.reading_lists.get(course_id)# get more detailed information about a specific reading listreading_list_id=reading_lists['reading_list'][0]['id']alma.courses.reading_lists(course_id,reading_list_id,view='full')# get citations for a reading listalma.courses.citations(course_id,reading_list_id)Access UsersAlma provides a set of Web services for handling user information, enabling you to quickly and easily manipulate user details. These Web services can be used by external systems—such as student information systems (SIS)—to retrieve or update user data.# Get a list of users or filter on search parametersusers=alma.users.get(query={'first_name':'Sterling','last_name':'Archer'})# get more information on that useruser_id=users['user'][0]['primary_id']alma.users.get(user_id)# get all loans or requests for a user. Makes multiple calls if necessary.loans=alma.user.loans.get(user_id,all_records=True)requests=alma.user.requests.get(user_id,all_records=True)# get deposits or fees for a userdeposits=alma.users.deposits.get(user_id)fees=alma.users.fees.get(user_id)Access AcquisitionsAlma provides a set of Web services for handling acquisitions information, enabling you to quickly and easily manipulate acquisitions details. These Web services can be used by external systems - such as subscription agent systems - to retrieve or update acquisitions data.# get all fundsalma.acq.funds.get(all_records=True)# get po_lines by searchamazon_lines=alma.acq.po_lines.get(query={'vendor_account':'AMAZON'})single_line_id=amazon_lines['po_line'][0]['number']# or by a specific line numberalma.acq.po_lines.get(single_line_id)# search for a vendoralma.acq.vendors.get(status='active',query={'name':'AMAZON'})# or get a specific vendoralma.acq.vendors.get('AMAZON.COM')# get invoices or polines for a specific vendoralma.acq.vendors.get_invoices('AMAZON.COM')alma.acq.vendors.get_po_lines('AMAZON.COM')# or get specific invoicesalma.acq.invoices.get('invoice_id')# get all licensesalma.acq.licenses.get(all_records=True)Access Configuration SettingsAlma provides a set of Web services for handling Configuration related information, enabling you to quickly and easily receive configuration details. These Web services can be used by external systems in order to get list of possible data.# Get libraries, locations, departments, and hourslibraries=alma.conf.units.get_libaries()library_id=libraries['library'][0]['code']locations=alma.conf.units.get_locations(library_id)hours=alma.conf.general.get_hours(library_id)departments=alma.conf.units.get_departments()# Get system code tablestable='UserGroups'alma.conf.general.get_code_table(table)# Get scheduled jobs and run historyjobs=alma.conf.jobs.get()job_id=jobs['job'][0]['id']run_history=alma.conf.jobs.get_instances(job_id)# Get sets and set memberssets=alma.conf.sets.get()set_id=sets['set'][0]['id']set_members=alma.conf.sets.get_members(set_id)# get profiles and remindersdepost_profiles=alma.conf.deposit_profiles.get()import_profiles=alma.conf.import_profiles.get()reminders=alma.conf.reminders.get()Access Resource Sharing PartnersAlma provides a set of Web services for handling Resource Sharing Partner information, enabling you to quickly and easily manipulate partner details. These Web services can be used by external systems to retrieve or update partner data.# get partnerspartners=alma.partners.get()Access ElectronicAlma provides a set of Web services for handling electronic information, enabling you to quickly and easily manipulate electronic details. These Web services can be used by external systems in order to retrieve or update electronic data.# get e-collectionscollections=alma.electronic.collections.get()collection_id=collections['electronic_collection'][0]['id']# get services for a collectionservices=alma.electronic.services.get(collection_id)service_id=services['electronic_service'][0]['id']# get portfolios for a servicealma.electronic.portfolios.get(collection_id,service_id)Access Task ListsAlma provides a set of Web services for handling task lists information, enabling you to quickly and easily manipulate their details. These Web services can be used by external systems.# get requested resources for a specific circulation deskalma.task_lists.resources.get(library_id,circ_desk)# get lending requests for a specific libraryalma.task_lists.lending.get(library_id)Attribution and ContactAuthor:Steve Pelkey