Configuration¶
Configuration
¶
Configuration(client: AlmaAPIClient)
Domain class for handling Alma Configuration API operations.
Foundation skeleton (issue #22) plus organizational-structure read methods (issue #24). Sibling tickets (issues 25-35) layer additional Configuration endpoints (locations, code tables, calendars, etc.) on top of this class.
This class uses the AlmaAPIClient as its foundation for all HTTP operations.
Initialize the Configuration domain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client
|
AlmaAPIClient
|
The AlmaAPIClient instance for making HTTP requests. |
required |
Source code in src/almaapitk/domains/configuration.py
get_environment
¶
Get the current environment from the underlying client.
Returns:
| Type | Description |
|---|---|
str
|
The environment string ('SANDBOX' or 'PRODUCTION'). |
Source code in src/almaapitk/domains/configuration.py
test_connection
¶
Test if the Alma API connection is working.
Delegates to AlmaAPIClient.test_connection. Configuration
endpoints are exercised by sibling tickets — at the foundation
level we simply confirm the client itself can reach the API.
Returns:
| Type | Description |
|---|---|
bool
|
True if the underlying client connection succeeds, False |
bool
|
otherwise. |
Source code in src/almaapitk/domains/configuration.py
list_libraries
¶
List all libraries configured in the Alma institution.
Calls GET /almaws/v1/conf/libraries and unwraps the Alma
response envelope ({"library": [...], "total_record_count": N})
into a flat list. The organizational-structure tables are small —
institutions typically have at most a few dozen libraries — so a
single call with a generous page size is sufficient.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of library dicts as returned by Alma. Returns an empty |
List[Dict[str, Any]]
|
list when the institution has no libraries configured (or |
List[Dict[str, Any]]
|
when the response envelope is missing the |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_library
¶
Get configuration details for a single library.
Calls GET /almaws/v1/conf/libraries/{libraryCode}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code (e.g., |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The library configuration dict as returned by Alma. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails (including 404 when the library code does not exist). |
Source code in src/almaapitk/domains/configuration.py
list_departments
¶
List all departments configured in the Alma institution.
Calls GET /almaws/v1/conf/departments and unwraps the Alma
response envelope ({"department": [...], "total_record_count": N})
into a flat list.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of department dicts. Returns an empty list when the |
List[Dict[str, Any]]
|
institution has no departments configured. |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
list_circ_desks
¶
List circulation desks configured for a given library.
Calls GET /almaws/v1/conf/libraries/{libraryCode}/circ-desks
and unwraps the Alma envelope
({"circ_desk": [...], "total_record_count": N}) into a flat
list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code whose circ desks to list. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of circ-desk dicts. Returns an empty list when the |
List[Dict[str, Any]]
|
library has no circ desks configured. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_circ_desk
¶
Get configuration details for a single circulation desk.
Calls
GET /almaws/v1/conf/libraries/{libraryCode}/circ-desks/{circDeskCode}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code that owns the circ desk. |
required |
circ_desk_code
|
str
|
The circulation-desk code. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The circ-desk configuration dict as returned by Alma. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If either code is empty or not a string. |
AlmaAPIError
|
If the API request fails (including 404 when the circ desk does not exist). |
Source code in src/almaapitk/domains/configuration.py
list_locations
¶
List all locations configured for a given library.
Calls GET /almaws/v1/conf/libraries/{libraryCode}/locations
and unwraps the Alma response envelope
({"location": [...], "total_record_count": N}) into a flat
list. Locations are scoped to a single library — the same
locationCode may be reused by another library — so callers
must always supply library_code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code whose locations to list. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of location dicts as returned by Alma. Returns an empty |
List[Dict[str, Any]]
|
list when the library has no locations configured (or when |
List[Dict[str, Any]]
|
the response envelope is missing the |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_location
¶
Get configuration details for a single location.
Calls
GET /almaws/v1/conf/libraries/{libraryCode}/locations/{locationCode}.
Note: location codes are unique per library, not globally.
The same location_code value may be reused across libraries,
so callers must always supply both codes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code that owns the location. |
required |
location_code
|
str
|
The location code (unique within |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The location configuration dict as returned by Alma. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If either code is empty or not a string. |
AlmaAPIError
|
If the API request fails (including 404 when the location does not exist within the library). |
Source code in src/almaapitk/domains/configuration.py
create_location
¶
create_location(
library_code: str, location_data: Dict[str, Any]
) -> AlmaResponse
Create a new location within a library.
Wraps
POST /almaws/v1/conf/libraries/{libraryCode}/locations. The
body Alma expects is the location object directly (not wrapped).
location_data must include at minimum the code, name,
and type fields Alma requires; the rest of the payload
(description, fulfillment unit, call-number type, etc.) is
passed through verbatim so callers can build any location Alma
accepts without waiting for explicit kwargs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code the new location will belong to. |
required |
location_data
|
Dict[str, Any]
|
Location object payload. Required keys:
|
required |
Returns:
| Type | Description |
|---|---|
AlmaResponse
|
AlmaResponse wrapping the create response. The created |
AlmaResponse
|
location body lives on |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
On API failure (typed subclass when the Alma
error code or HTTP status maps to one — see
|
Example
response = config.create_location( ... "MAIN", ... { ... "code": "STACKS", ... "name": "Main Stacks", ... "type": {"value": "OPEN"}, ... }, ... ) created_code = response.data.get("code")
Source code in src/almaapitk/domains/configuration.py
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | |
update_location
¶
update_location(
library_code: str,
location_code: str,
location_data: Dict[str, Any],
) -> AlmaResponse
Update an existing location's metadata.
Wraps
PUT /almaws/v1/conf/libraries/{libraryCode}/locations/{locationCode}.
Alma expects a complete location object (see get_location for
the shape Alma returns); callers typically read the current
location, mutate the fields they want to change, and pass the
whole dict here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code that owns the location. |
required |
location_code
|
str
|
The location code to update. |
required |
location_data
|
Dict[str, Any]
|
Full location object payload. Must be a non-empty dict. |
required |
Returns:
| Type | Description |
|---|---|
AlmaResponse
|
AlmaResponse wrapping the updated location object. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If either code is empty / not a string,
or |
AlmaAPIError
|
On API failure. |
Example
info = config.get_location("MAIN", "STACKS") info["name"] = "Main Stacks (renamed)" response = config.update_location("MAIN", "STACKS", info)
Source code in src/almaapitk/domains/configuration.py
delete_location
¶
delete_location(
library_code: str, location_code: str
) -> AlmaResponse
Delete a location.
Wraps
DELETE /almaws/v1/conf/libraries/{libraryCode}/locations/{locationCode}.
Failure mode: Alma rejects the delete with a typed 4xx error
when the location still has linked items (or holdings). This
method does NOT swallow that error — the underlying
AlmaAPIError propagates verbatim with its alma_code,
tracking_id, and message intact so callers can surface
Alma's own diagnostic to the operator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library_code
|
str
|
The Alma library code that owns the location. |
required |
location_code
|
str
|
The location code to delete. |
required |
Returns:
| Type | Description |
|---|---|
AlmaResponse
|
AlmaResponse wrapping the delete response. Alma typically |
AlmaResponse
|
returns an empty body on a successful delete. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If either code is empty / not a string. |
AlmaAPIError
|
On API failure (e.g. when the location has linked items the API surface refuses to orphan). |
Source code in src/almaapitk/domains/configuration.py
list_code_tables
¶
List all code tables configured in the Alma institution.
Calls GET /almaws/v1/conf/code-tables and unwraps the Alma
response envelope ({"code_table": [...], "total_record_count": N})
into a flat list. The endpoint takes no scope filter — the
Alma documentation does not advertise one and an audit flagged
it as undocumented, so this method intentionally exposes no
filter parameters.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of code-table summary dicts (typically containing |
List[Dict[str, Any]]
|
|
List[Dict[str, Any]]
|
empty list when the institution has no code tables (or when |
List[Dict[str, Any]]
|
the response envelope is missing the |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_code_table
¶
Get a single code table including all of its rows.
Calls GET /almaws/v1/conf/code-tables/{codeTableName}. The
full code-table object is returned unwrapped — including the
row collection that holds the table's individual entries —
so callers can mutate rows in place and pass the dict back to
:meth:update_code_table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code_table_name
|
str
|
The Alma code-table name (e.g.
|
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The full code-table object as returned by Alma. Includes |
Dict[str, Any]
|
metadata ( |
Dict[str, Any]
|
and a top-level |
Dict[str, Any]
|
Response-shape note: the entries live at the top-level |
Dict[str, Any]
|
|
Dict[str, Any]
|
via |
Dict[str, Any]
|
list endpoints (where the wrapper is ``{"rows": {"row": |
Dict[str, Any]
|
[...]}}``) — verified live against SANDBOX 2026-05-07. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails (including 400 with
Alma error code |
Source code in src/almaapitk/domains/configuration.py
update_code_table
¶
update_code_table(
code_table_name: str, code_table_data: Dict[str, Any]
) -> AlmaResponse
Replace an entire code table.
Wraps PUT /almaws/v1/conf/code-tables/{codeTableName}. The
PUT replaces the entire table — it is NOT a partial update.
Alma requires the complete code-table object on the wire,
including every row that should remain in the table. Callers
typically read the table with :meth:get_code_table, mutate
the dict (add / remove / edit row entries), then pass the
whole thing back here. Rows omitted from the request body are
dropped from the table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code_table_name
|
str
|
The Alma code-table name (e.g.
|
required |
code_table_data
|
Dict[str, Any]
|
Full code-table object payload. Must be a non-empty dict. |
required |
Returns:
| Type | Description |
|---|---|
AlmaResponse
|
AlmaResponse wrapping the updated code-table object. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
On API failure. Notable Alma error codes for
this endpoint include |
Example
table = config.get_code_table("AcqInvoiceLineType")
Mutate rows in place — e.g. flip a row's enabled flag.¶
for row in table.get("row", []): ... if row.get("code") == "REGULAR": ... row["enabled"] = {"value": "false"} response = config.update_code_table( ... "AcqInvoiceLineType", table ... )
Source code in src/almaapitk/domains/configuration.py
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | |
list_mapping_tables
¶
List all mapping tables configured in the Alma institution.
Calls GET /almaws/v1/conf/mapping-tables and unwraps the Alma
response envelope
({"mapping_table": [...], "total_record_count": N}) into a
flat list. The endpoint takes no scope filter — mirroring
:meth:list_code_tables, this method intentionally exposes no
filter parameters.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of mapping-table summary dicts (typically containing |
List[Dict[str, Any]]
|
|
List[Dict[str, Any]]
|
empty list when the institution has no mapping tables (or |
List[Dict[str, Any]]
|
when the response envelope is missing the |
List[Dict[str, Any]]
|
key). |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_mapping_table
¶
Get a single mapping table including all of its rows.
Calls GET /almaws/v1/conf/mapping-tables/{mappingTableName}.
The full mapping-table object is returned unwrapped — including
the row collection that holds the table's individual entries
— so callers can mutate rows in place and pass the dict back to
:meth:update_mapping_table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mapping_table_name
|
str
|
The Alma mapping-table name. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The full mapping-table object as returned by Alma. Includes |
Dict[str, Any]
|
metadata ( |
Dict[str, Any]
|
and a top-level |
Dict[str, Any]
|
Response-shape note: the entries live at the top-level |
Dict[str, Any]
|
|
Dict[str, Any]
|
via |
Dict[str, Any]
|
and differs from some other Alma list endpoints whose |
Dict[str, Any]
|
wrapper is |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails (including 400 with
Alma error code |
Source code in src/almaapitk/domains/configuration.py
update_mapping_table
¶
update_mapping_table(
mapping_table_name: str,
mapping_table_data: Dict[str, Any],
) -> AlmaResponse
Replace an entire mapping table.
Wraps PUT /almaws/v1/conf/mapping-tables/{mappingTableName}.
The PUT replaces the entire table — it is NOT a partial
update. Alma requires the complete mapping-table object on the
wire, including every row that should remain in the table.
Mapping tables can be large; callers typically read the table
with :meth:get_mapping_table, mutate the dict (add / remove /
edit row entries), then pass the whole thing back here. Rows
omitted from the request body are dropped from the table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mapping_table_name
|
str
|
The Alma mapping-table name. |
required |
mapping_table_data
|
Dict[str, Any]
|
Full mapping-table object payload. Must be a non-empty dict. |
required |
Returns:
| Type | Description |
|---|---|
AlmaResponse
|
AlmaResponse wrapping the updated mapping-table object. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
On API failure. Notable Alma error codes for
this endpoint include |
Example
table = config.get_mapping_table("RecallDueDate")
Mutate rows in place — e.g. flip a row's enabled flag.¶
for row in table.get("row", []): ... if row.get("column0") == "STAFF": ... row["enabled"] = {"value": "false"} response = config.update_mapping_table( ... "RecallDueDate", table ... )
Source code in src/almaapitk/domains/configuration.py
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 | |
list_deposit_profiles
¶
List all deposit profiles configured in the Alma institution.
Calls GET /almaws/v1/conf/deposit-profiles and unwraps the
Alma response envelope
({"deposit_profile": [...], "total_record_count": N}) into a
flat list. Deposit profiles are typically few — a single call
with a generous page size is sufficient.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of deposit-profile dicts as returned by Alma. Returns an |
List[Dict[str, Any]]
|
empty list when the institution has no deposit profiles |
List[Dict[str, Any]]
|
configured (or when the response envelope is missing the |
List[Dict[str, Any]]
|
|
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_deposit_profile
¶
Get configuration details for a single deposit profile.
Calls GET /almaws/v1/conf/deposit-profiles/{deposit_profile_id}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
deposit_profile_id
|
str
|
The Alma deposit-profile identifier. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The deposit-profile configuration dict as returned by Alma. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails (including 4xx when the profile id does not exist). |
Source code in src/almaapitk/domains/configuration.py
list_import_profiles
¶
List all metadata-import profiles configured in the institution.
Calls GET /almaws/v1/conf/md-import-profiles and unwraps the
Alma response envelope
({"import_profile": [...], "total_record_count": N}) into a
flat list. The Alma developer-network docs use import_profile
as the singular envelope key for this endpoint; the older
md_import_profile form has not been observed on the wire.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of import-profile dicts as returned by Alma. Returns an |
List[Dict[str, Any]]
|
empty list when the institution has no import profiles |
List[Dict[str, Any]]
|
configured (or when the response envelope is missing the |
List[Dict[str, Any]]
|
|
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |
Source code in src/almaapitk/domains/configuration.py
get_import_profile
¶
Get configuration details for a single metadata-import profile.
Calls GET /almaws/v1/conf/md-import-profiles/{profile_id}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile_id
|
str
|
The Alma metadata-import-profile identifier. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The import-profile configuration dict as returned by Alma. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails. Notable Alma error
code for this endpoint: |
Source code in src/almaapitk/domains/configuration.py
list_letters
¶
List all letters configured in the Alma institution.
Calls GET /almaws/v1/conf/letters and unwraps the Alma
response envelope ({"letter": [...], "total_record_count": N})
into a flat list. Letters define the templates Alma uses to
render notifications (overdue, hold-pickup, fulfillment, etc.) —
the catalogue is small (a few hundred at most) so a single call
with a generous page size is sufficient.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of letter dicts as returned by Alma. Returns an empty |
List[Dict[str, Any]]
|
list when the institution has no letters configured (or when |
List[Dict[str, Any]]
|
the response envelope is missing the |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. Notable Alma error
code for this endpoint: |
Source code in src/almaapitk/domains/configuration.py
get_letter
¶
Get a single letter's full configuration including its template.
Calls GET /almaws/v1/conf/letters/{letterCode}. The full
letter object is returned unwrapped — including subject,
body, description, enabled, letter_name, and the
letter_template_xsl payload that holds the XSL template.
Callers typically read the letter, mutate the dict (edit
subject / template), and pass the whole thing back to
:meth:update_letter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
letter_code
|
str
|
The Alma letter code (e.g. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The full letter object as returned by Alma. The response is |
Dict[str, Any]
|
the raw Alma payload — sub-objects like |
Dict[str, Any]
|
|
Dict[str, Any]
|
|
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails. Notable Alma error
codes for this endpoint: |
Source code in src/almaapitk/domains/configuration.py
update_letter
¶
update_letter(
letter_code: str, letter_data: Dict[str, Any]
) -> AlmaResponse
Replace an entire letter template.
Wraps PUT /almaws/v1/conf/letters/{letterCode}. The PUT
replaces the entire letter — it is NOT a partial update. Alma
requires the complete letter object on the wire (the XSL
template body, the enabled flag, the channel, etc.). Callers
typically read the letter with :meth:get_letter, mutate the
dict, then pass the whole thing back here. Fields omitted from
the request body are dropped from the letter.
.. note::
The Alma letters PUT endpoint is XML-only — it rejects
JSON with Alma error code 60105 ("JSON is not supported
for this API."). This method serialises letter_data
to XML internally before sending and forces an
application/json Accept header so the response is
still parsed as JSON into AlmaResponse.data. Callers
pass and receive Python dicts; the XML conversion is an
implementation detail. (Resolved by issue #114, 2026-05-08.)
.. note::
Some letter fields are derived/read-only on Alma's
side — notably description, which is sourced from
the labels code-table mapping rather than stored on the
letter object. Mutating such fields in the request body
yields a 200 response but no observable change. The
mutable surface includes enabled, customized,
channel, and the XSL template body itself.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
letter_code
|
str
|
The Alma letter code (e.g.
|
required |
letter_data
|
Dict[str, Any]
|
Full letter object payload. Must be a non-empty dict. |
required |
Returns:
| Type | Description |
|---|---|
AlmaResponse
|
AlmaResponse wrapping the updated letter object. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
On API failure. Notable Alma error codes for
this endpoint include |
Example
letter = config.get_letter("OverdueAndLostLoanLetter") letter["subject"] = "Overdue notice — please return" response = config.update_letter( ... "OverdueAndLostLoanLetter", letter ... )
Source code in src/almaapitk/domains/configuration.py
1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 | |
list_printers
¶
List all printers configured in the Alma institution.
Calls GET /almaws/v1/conf/printers and unwraps the Alma
response envelope ({"printer": [...], "total_record_count": N})
into a flat list. The printer catalogue is institution-wide and
typically small — a single call with a generous page size is
sufficient.
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of printer dicts as returned by Alma. Returns an empty |
List[Dict[str, Any]]
|
list when the institution has no printers configured (or |
List[Dict[str, Any]]
|
when the response envelope is missing the |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. Notable Alma error
codes for this endpoint: |
Source code in src/almaapitk/domains/configuration.py
get_printer
¶
Get configuration details for a single printer.
Calls GET /almaws/v1/conf/printers/{printer_id}.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
printer_id
|
str
|
The Alma printer identifier. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The printer configuration dict as returned by Alma. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
If the API request fails. Notable Alma error
code for this endpoint: |
Source code in src/almaapitk/domains/configuration.py
run_workflow
¶
Execute a configured Alma workflow.
Wraps POST /almaws/v1/conf/workflows/{workflow_id}.
WARNING: This method actually triggers an Alma workflow.
Side effects depend entirely on the workflow's configuration —
a workflow can mutate records, send notifications, kick off
long-running jobs, etc. Test against a known-safe workflow_id
only; never bind this method to untrusted input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_id
|
str
|
The Alma workflow identifier to execute. |
required |
parameters
|
Optional[Dict[str, Any]]
|
Optional workflow-specific parameter payload.
When provided, sent as the JSON request body. When
|
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The parsed response dict from Alma. Alma typically returns a |
Dict[str, Any]
|
workflow-instance object containing at least an instance id |
Dict[str, Any]
|
and a status code; the exact shape varies per workflow. |
Raises:
| Type | Description |
|---|---|
AlmaValidationError
|
If |
AlmaAPIError
|
On API failure. Notable Alma error codes for
this endpoint include |
Example
result = config.run_workflow( ... "MY_SAFE_TEST_WORKFLOW", ... {"input_param": "value"}, ... ) instance_id = result.get("id")
Source code in src/almaapitk/domains/configuration.py
1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 | |
get_fee_transactions_report
¶
Fetch the Alma fee-transactions report.
Wraps GET /almaws/v1/conf/utilities/fee-transactions and
unwraps the Alma response envelope
({"fee": [...], "total_record_count": N}) into a
flat list. The endpoint accepts a flexible set of filters
(status, library, from_date, to_date,
transaction_type, etc.); rather than enumerate them in the
signature this method forwards arbitrary keyword args verbatim
as query parameters so callers can drive any filter Alma
accepts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**filters
|
Any
|
Arbitrary query-parameter filters forwarded to Alma. Common filters per the Alma docs:
|
{}
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of fee-transaction dicts as returned by Alma. Returns |
List[Dict[str, Any]]
|
an empty list when no matching transactions are found (or |
List[Dict[str, Any]]
|
when the response envelope is missing the |
List[Dict[str, Any]]
|
|
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. Notable Alma error
codes for this endpoint include |
Example
txs = config.get_fee_transactions_report( ... library="MAIN", ... from_date="2026-01-01", ... to_date="2026-01-31", ... )
Source code in src/almaapitk/domains/configuration.py
1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 | |
get_general_configuration
¶
Get the institution's general configuration.
Calls GET /almaws/v1/conf/general and returns the unwrapped
institutional-configuration dict (Alma surfaces fields like
institution, default_language, default_currency,
timezone, etc. directly at the top level of the response —
there is no envelope wrapper).
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
The general-configuration dict as returned by Alma. Returns |
Dict[str, Any]
|
an empty dict if Alma returns an empty body. |
Raises:
| Type | Description |
|---|---|
AlmaAPIError
|
If the API request fails. |