FOLIO Auto Renew
An early preview of the Umbrellaleaf automatic renewals
folio-auto-renew provides a small set of async utilities to:
- Query FOLIO for loans that meet renewal criteria.
- Optionally filter loans by patron barcode patterns (optional).
- Submit renewal requests through the FOLIO circulation API.
This package is intended for libraries that want to automate recurring loan renewals using institution-specific policies.
Installation
python -m pip install folio-auto-renew
This library requires python 3.10+
Usage
from datetime import datetime, timezone
from folioclient import FolioClient
from folio_auto_renew import stream_loans, renew_loans
client = FolioClient(...)
renewable_loans = stream_loans(
client=client,
patron_barcode_patterns=None,
due_date=datetime.now(timezone.utc),
)
await renew_loans(client, renewable_loans)
Patron Barcode Filtering
Loans can be filtered to only patrons who have barcodes starting with certain prefixes. For example:
renewable_loans = stream_loans(
client=client,
patron_barcode_patterns=[
"2112",
"3335",
],
due_date=cutoff_date,
)
Passing None disables barcode filtering and processes all matching loans.
Customizing the base CQL query
The default query to identify loans is intended to be used by Five Colleges. Most libraries will need to replace this query before using the package.
The template is exposed as RENEWABLES_QUERY_TEMPLATE and can be replaced like this:
import folio_auto_renew
folio_auto_renew.RENEWABLES_QUERY_TEMPLATE = (
'status="Open" '
'AND itemStatus=="Checked Out" '
'AND loanPolicyId=="<your-loan-policy-id>" '
'AND dueDate<="{:%Y-%m-%dT%H:00:00%z}" '
'sortBy id/sort.ascending'
)
It is important to preserve the due-date format placeholder so the cutoff date can be injected correctly.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file folio_auto_renew-0.0.2.tar.gz.
File metadata
- Download URL: folio_auto_renew-0.0.2.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d53e68ba76d367d1a2feecaec1d9906a3851d322fa04b9b2a70fa22db4614529
|
|
| MD5 |
41b5c903f73a35a95aebd93ce20ff516
|
|
| BLAKE2b-256 |
867091bd494ccf6bb5581c79ca2d2d26ea077ca6d3be03deddae37be7ae9fbb7
|
Provenance
The following attestation bundles were made for folio_auto_renew-0.0.2.tar.gz:
Publisher:
publish.yml on Five-Colleges-Incorporated/folio-auto-renew
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
folio_auto_renew-0.0.2.tar.gz -
Subject digest:
d53e68ba76d367d1a2feecaec1d9906a3851d322fa04b9b2a70fa22db4614529 - Sigstore transparency entry: 2466478132
- Sigstore integration time:
-
Permalink:
Five-Colleges-Incorporated/folio-auto-renew@143dd4231ffb7da7ee057d16efe36cadef439662 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/Five-Colleges-Incorporated
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@143dd4231ffb7da7ee057d16efe36cadef439662 -
Trigger Event:
push
-
Statement type:
File details
Details for the file folio_auto_renew-0.0.2-py3-none-any.whl.
File metadata
- Download URL: folio_auto_renew-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31b5ad6727ab2f88a0a0215eb78a1d138dddccec1871464209bf933c6712b2a3
|
|
| MD5 |
d1dc9a29fd64bf84e4d1882694e757af
|
|
| BLAKE2b-256 |
cdad54846eb79262cfe6fa2403472579aa85d14b50985ea433f5991e864cd1cc
|
Provenance
The following attestation bundles were made for folio_auto_renew-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on Five-Colleges-Incorporated/folio-auto-renew
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
folio_auto_renew-0.0.2-py3-none-any.whl -
Subject digest:
31b5ad6727ab2f88a0a0215eb78a1d138dddccec1871464209bf933c6712b2a3 - Sigstore transparency entry: 2466478149
- Sigstore integration time:
-
Permalink:
Five-Colleges-Incorporated/folio-auto-renew@143dd4231ffb7da7ee057d16efe36cadef439662 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/Five-Colleges-Incorporated
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@143dd4231ffb7da7ee057d16efe36cadef439662 -
Trigger Event:
push
-
Statement type: