Skip to content

Commit abd4a78

Browse files
authored
Merge changes from the 3.2.1 release (#61)
#60 created the 3.2.1 release while the 4.0 release was still in progress. This pulls in the relevant changes and makes them work with the 4.0 structure. #59 was not included because the transformation logic is going to be redone in 4.0.
1 parent 8372945 commit abd4a78

10 files changed

Lines changed: 638 additions & 689 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ Please see [MIGRATING.md](./MIGRATING.md) for information on breaking changes.
1717

1818
### Removed
1919

20+
## [3.2.1] - November 2025
21+
22+
### Fixed
23+
24+
- Endpoints which return system fields before the record list
25+
- Example python script
26+
- Columns with mixed and incompatible datatypes
27+
- Endless looping for calendar/calendars endpoint
28+
2029
## [3.2.0] - September 2025
2130

2231
### Added

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ To install LDLite or upgrade to the latest version:
2929
```bash
3030
$ python -m pip install --upgrade ldlite
3131
```
32-
3332
(On some systems it might be `python3` rather than `python`.)
33+
34+
If you encounter the error `ImportError: no pq wrapper available.` you can either
35+
* Run `python -m pip install psycopg[binary]`
36+
* Ensure the libpq package is installed for your operating system
37+
3438
Check out the [migration guide](./MIGRATING.md) for more information about major version upgrades.
3539

3640
*Optional* If you intend to use the `connect_db_postgres()` method install the binary provider:

examples/folio_demo.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import sys
55

6+
import httpx
7+
68
import ldlite
79

810
# Demo sites
@@ -30,15 +32,16 @@
3032
)
3133

3234
ld.connect_db(filename="ldlite.db")
33-
# For PostgreSQL, use connect_db_postgresql() instead of connect_db():
35+
# For PostgreSQL, use connect_db_postgresql() instead:
3436
# ld.connect_db_postgresql(dsn='dbname=ldlite host=localhost user=ldlite')
3537

3638
queries: list[tuple[str, ...] | tuple[str, str, object, int]] = [
3739
("folio_agreements.entitlement", "/erm/entitlements"),
3840
("folio_agreements.erm_resource", "/erm/resource"),
3941
("folio_agreements.org", "/erm/org"),
4042
("folio_agreements.refdata_value", "/erm/refdata"),
41-
("folio_agreements.usage_data_provider", "/usage-data-providers"),
43+
# This endpoint doesn't work in EBSCO environments
44+
# ("folio_agreements.usage_data_provider", "/usage-data-providers"),
4245
("folio_audit.circulation_logs", "/audit-data/circulation/logs"),
4346
("folio_circulation.audit_loan", "/loan-storage/loan-history"),
4447
(
@@ -165,7 +168,7 @@
165168
"/acquisitions-units-storage/memberships",
166169
),
167170
("folio_orders.alert", "/orders-storage/alerts"),
168-
("folio_orders.order_invoice_relationship/orders-storage/order-invoice-relns"),
171+
("folio_orders.order_invoice_relationship", "/orders-storage/order-invoice-relns"),
169172
("folio_orders.order_templates", "/orders-storage/order-templates"),
170173
("folio_orders.pieces", "/orders-storage/pieces"),
171174
("folio_orders.po_line", "/orders-storage/po-lines"),
@@ -176,36 +179,42 @@
176179
("folio_organizations.contacts", "/organizations-storage/contacts"),
177180
("folio_organizations.emails", "/organizations-storage/emails"),
178181
("folio_organizations.interfaces", "/organizations-storage/interfaces"),
179-
("folio_organizations.organizations", "/organizations-storage/organizations"),
182+
("folio_organizations.organizations", "/organizations/organizations"),
180183
("folio_organizations.phone_numbers", "/organizations-storage/phone-numbers"),
181184
("folio_organizations.urls", "/organizations-storage/urls"),
182-
("folio_source_record.records", "/source-storage/records", {}, 2),
185+
("folio_source_record.records", "/source-storage/records", 2),
183186
("folio_users.addresstype", "/addresstypes"),
184187
("folio_users.departments", "/departments"),
185188
("folio_users.groups", "/groups"),
186189
("folio_users.proxyfor", "/proxiesfor"),
187190
("folio_users.users", "/users"),
188191
]
189192

193+
errors: list[tuple[str, BaseException]] = []
190194
tables: list[str] = []
191195
for q in queries:
192196
try:
193-
if len(q) == 4:
197+
if len(q) == 3:
194198
tables += ld.query(
195199
table=q[0],
196200
path=q[1],
197-
query=str(q[2]),
198-
json_depth=int(q[3]),
201+
json_depth=int(q[2]),
199202
)
200203
else:
201-
tables += ld.query(table=q[0], path=q[1], query=str(q[2]))
202-
except (ValueError, RuntimeError) as e:
203-
print(
204-
'folio_demo.py: error processing "' + str(q[1]) + '": ' + str(e),
205-
file=sys.stderr,
206-
)
204+
tables += ld.query(table=q[0], path=q[1])
205+
except (ValueError, RuntimeError, httpx.HTTPError) as e:
206+
errors += [(q[1], e)]
207207
print()
208208
print("Tables:")
209209
for t in tables:
210210
print(t)
211211
print("(" + str(len(tables)) + " tables)")
212+
if len(errors) > 0:
213+
print()
214+
print("Errors:")
215+
for p, e in errors:
216+
print(
217+
'folio_demo.py: error processing "' + p + '": ' + str(e),
218+
file=sys.stderr,
219+
)
220+
print("(" + str(len(errors)) + " errors)")

0 commit comments

Comments
 (0)