Skip to main content

FOLIO Auto Renew

An early preview of the Umbrellaleaf automatic renewals

folio-auto-renew provides a small set of async utilities to:

  1. Query FOLIO for loans that meet renewal criteria.
  2. Optionally filter loans by patron barcode patterns (optional).
  3. 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.

Metadata

Release files for folio-auto-renew 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for folio-auto-renew 0.0.2
File Size Uploaded
folio_auto_renew-0.0.2.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for folio-auto-renew 0.0.2
File Interpreter ABI Platform
folio_auto_renew-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / folio_auto_renew-0.0.2.tar.gz

Download URL folio_auto_renew-0.0.2.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d53e68ba76d367d1a2feecaec1d9906a3851d322fa04b9b2a70fa22db4614529
BLAKE2b-256 checksum
How to use checksums
867091bd494ccf6bb5581c79ca2d2d26ea077ca6d3be03deddae37be7ae9fbb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release files / folio_auto_renew-0.0.2-py3-none-any.whl

Download URL folio_auto_renew-0.0.2-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
31b5ad6727ab2f88a0a0215eb78a1d138dddccec1871464209bf933c6712b2a3
BLAKE2b-256 checksum
How to use checksums
cdad54846eb79262cfe6fa2403472579aa85d14b50985ea433f5991e864cd1cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page