Client#

class almonaut.client.AlmaApiClient(api_key, host='https://api-ca.hosted.exlibrisgroup.com', url_prefix='almaws', version='v1')#

The Alma API client.

Parameters:
  • api_key (str) – The Alma API key to use.

  • host (str, default: 'https://api-ca.hosted.exlibrisgroup.com') – Hostname of the Alma API instance.

  • url_prefix (str, default: 'almaws') – Prefix before the API version.

  • version (str, default: 'v1') – API version to use.

get_fund(id_, format_='json')#

Get a fund record.

Parameters:
  • id_ (str) – Alma fund ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

Fund

The extra_params dict can include:

view

brief|full

get_funds(format_='json', limit=5, all_records=False, extra_params={})#

Get fund records.

Parameters:
  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

Funds

The extra_params dict can include:

view

brief|full

get_fund_transactions(fund_id, format_='json', limit=5, all_records=False, extra_params={})#

Get fund transaction records.

Parameters:
  • fund_id (str) – Alma fund ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

FundTransactions

get_invoice(invoice_id, format_='json')#

Get an invoice record.

Parameters:
  • invoice_id (str) – Alma invoice ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

Invoice

The extra_params dict can include:

expand

attachments|none

view

brief|full

get_invoices(format_='json', limit=5, all_records=False, extra_params={})#

Get invoice records.

Parameters:
  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

Invoices

The extra_params dict can include:

base_status

ACTIVE|All|CLOSED

creation_form

(various)

expand

attachments|none

invoice_workflow_status

(various)

owner

(invoice owner: can be the institution code or a library code)

view

brief|full

get_invoice_line(invoice_id, invoice_line_id, format_='json')#

Get an invoice line record.

Parameters:
  • invoice_id (str) – Alma invoice ID.

  • invoice_line_id (str) – Alma invoice line ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

InvoiceLine

get_invoice_lines(invoice_id, format_='json', limit=5, all_records=False, extra_params={})#

Get invoice line records.

Parameters:
  • invoice_id (str) – Alma invoice ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

InvoiceLines

get_license(code, format_='json')#

Get a license record.

Parameters:
  • code (str) – Alma license code.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

License

The extra_params dict can include:

expand

attachments|none

include_blank_terms

true|false

get_licenses(format_='json', limit=5, all_records=False, extra_params={})#

Get license records.

Parameters:
  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

Licenses

get_po_line(number, format_='json')#

Get a PO Line record.

Parameters:
  • number (str) – Alma PO Line number.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

PoLine

get_po_lines(format_='json', limit=5, all_records=False, extra_params={})#

Get PO Line records.

Parameters:
  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

PoLines

The extra_params dict can include:

acquisition_method

PURCHASE|ALL

expand

locations|notes|locations, notes

status

ACTIVE|ALL|ALL_WITH_CLOSED|CANCELLED|CLOSED

q

e.g.: number~123456, po_number~PO123, title~spenser

get_electronic_collection(collection_id, format_='json')#

Get an Electronic Collection record.

Parameters:
  • collection_id (str) – Alma electronic collection ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

ElectronicCollection

get_electronic_collections(format_='json', limit=5, all_records=False, extra_params={})#

Get Electronic Collection records.

Parameters:
  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

ElectronicCollections

get_electronic_service(collection_id, service_id, format_='json')#

Get an Electronic Service record.

Parameters:
  • collection_id (str) – Alma electronic collection ID.

  • service_id (str) – Alma electronic service ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

ElectronicService

get_electronic_services(collection_id, format_='json', limit=5, all_records=False, extra_params={})#

Get Electronic Service records.

Parameters:
  • collection_id (str) – Alma electronic collection ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

ElectronicServices

get_portfolio(collection_id, service_id, portfolio_id, format_='json')#

Get a Portfolio record.

Parameters:
  • collection_id (str) – Alma electronic collection ID.

  • service_id (str) – Alma electronic service ID.

  • portfolio_id (str) – Alma portfolio ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

Return type:

Portfolio

get_portfolios(collection_id, service_id, format_='json', limit=5, all_records=False, extra_params={})#

Get Portfolio records.

Parameters:
  • collection_id (str) – Alma electronic collection ID.

  • service_id (str) – Alma electronic service ID.

  • format_ (str, default: 'json') – Format of the raw returned data.

  • limit (int, default: 5) – The maximum number of records to be returned.

  • all_records (bool, default: False) – Whether or not all matching records should be returned (overrides limit).

  • extra_params (default: {}) – Additional parameters.

Return type:

Portfolios