Skip to main content

LDLite-RTR

Copyright (C) 2021-2024 The Open Library Foundation. This software is distributed under the terms of the Apache License, Version 2.0. See the file LICENSE for more information.

LDLite-RTR is a fork of the original LDLite tool from the Library Data Platform project that supports Refresh Token Rotation (RTR) in the Quesnelia release (and later) of FOLIO. It should function as a drop-in replacement for the original ldlite library.

LDLite-RTR is a lightweight, open source reporting tool for Okapi-based services. It is part of the Library Data Platform project and provides basic LDP functions without requiring the server to be installed.

To install LDLite or upgrade to the latest version:

$ python -m pip install --upgrade ldlite-rtr

(On some systems it might be python3 rather than python.)

To extract and transform data:

$ python
>> > import ldlite
>> > ld = ldlite.LDLite()
>> > ld.connect_okapi(url='https://folio-juniper-okapi.dev.folio.org/',
                      tenant='diku',
                      user='diku_admin',
                      password='admin')
>> > db = ld.connect_db()
>> > _ = ld.query(table='g', path='/groups', query='cql.allRecords=1 sortby id')
ldlite: querying: / groups
ldlite: created
tables: g, g__t, g__tcatalog
>> > ld.select(table='g__t')
 __id |                  id                  |         desc          | expiration_offset_in_days |   group   
------+--------------------------------------+-----------------------+---------------------------+-----------
    1 | 3684a786-6671-4268-8ed0-9db82ebca60b | Staff Member          |                       730 | staff     
    2 | 503a81cd-6c26-400f-b620-14c08943697c | Faculty Member        |                       365 | faculty   
    3 | ad0bc554-d5bc-463c-85d1-5562127ae91b | Graduate Student      |                           | graduate  
    4 | bdc2b6d4-5ceb-4a12-ab46-249b9a68473e | Undergraduate Student |                           | undergrad 
(4 rows)
>> > _ = ld.query(table='u', path='/users', query='cql.allRecords=1 sortby id')
ldlite: querying: / users
ldlite: created
tables: u, u__t, u__t__departments, u__t__personal__addresses, u__t__proxy_for, u__tcatalog
>> > cur = db.cursor()
>> > _ = cur.execute("""
        CREATE TABLE user_groups AS
        SELECT u__t.id, u__t.username, g__t.group
            FROM u__t
                JOIN g__t ON u__t.patron_group = g__t.id;
        """)
>> > ld.export_excel(table='user_groups', filename='groups.xlsx')

Features

  • Queries Okapi-based modules and transforms JSON data into tables for easier reporting
  • Full SQL query support and export to CSV or Excel
  • Compatible with DBeaver database tool
  • Compatible with DuckDB and PostgreSQL database systems
  • PostgreSQL support enables:
    • Sharing the data in a multiuser database
    • Access to the data using more database tools
    • Storing the data in an existing LDP database if available
  • Runs on Windows, macOS, and Linux.

More examples

LDLite resources

Note: the following resources are for the original ldlite project. There shouldn't be any significant differences right now, but that could change

  • LDLite API documentation

  • The LDP project runs a Slack workspace which is a good place to ask questions or to share your work. It also serves as a community space for working together on library data problems. To request an invitation, use the Contact page on the LDP website.

Other resources

Release files for ldlite-rtr 0.1.1

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

Source distribution (sdist)

Source distribution for ldlite-rtr 0.1.1
File Size Uploaded
ldlite_rtr-0.1.1.tar.gz 19.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ldlite-rtr 0.1.1
File Interpreter ABI Platform
ldlite_rtr-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 40.6 kB

Release files / ldlite_rtr-0.1.1.tar.gz

Download URL ldlite_rtr-0.1.1.tar.gz
Size 19.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1ac6ee5d1b55f82b7961f7fd05295bacdc0de68a968dac13d4030491a3fa443e
BLAKE2b-256 checksum
How to use checksums
9631c2545dcab623e29ad88da28b8a0c2d8a125cf042d7972510c5b19b756aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Jan 15, 2025.

Transparency log

Release files / ldlite_rtr-0.1.1-py3-none-any.whl

Download URL ldlite_rtr-0.1.1-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69e073411748b37c8b7ad291b11b444c741e1b6f217a21a2a1159b071a27458d
BLAKE2b-256 checksum
How to use checksums
4f456502a6ab0f7afa5ebd4ea4cdfc501deee6d9d556acf5a0b92f239b68fc5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

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 Jan 15, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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