Skip to content

ArchiveLabs/lenny

Repository files navigation

Lenny

Lenny is a free, open source, Library-in-a-Box for libraries to preserve and lend digital books.

Technologies

  • docker for deployment and containerization
  • nginx handles patron requests (reverse proxy to app)
  • FastAPI (python) as the web & API microframework
  • Minio API for storing digital assets (Amazon, Internet Archive, or local flat-file)
  • yaml for configuring library-level rules
  • postgres for the database
  • SQLAlchemy for the database python ORM
  • Readium LCP for DRM; see LCP Server
  • Readium Web SDK for a secure web reading experience
  • OPDS RSS-like standard for syndicating holdings

Endpoints

  • /v{1}/api
  • /v{1}/manage
  • /v{1}/read
  • /v{1}/opds
  • /v{1}/stats

Installation

To install and run Lenny as a production application:

curl -fsSL https://raw.githubusercontent.com/ArchiveLabs/lenny/refs/heads/main/install.sh | sudo sh

Development Setup

If you have git and docker installed on your system, the following commands will set up Lenny:

git clone [email protected]:ArchiveLabs/lenny.git
cd lenny
./run.sh

This process will run docker/configure.sh and generate a gitignored .env file with reasonable default values, if not present.

Navigate to localhost:8080 or whatever $LENNY_PORT is specified in your .env

You may enter the API container via:

docker exec -it lenny_api bash

Importing Test Books

# Run the importer: you can Ctrl+c after a few books are loaded (will load ~800)
docker exec -it lenny_api python scripts/load_open_books.py 

Testing Readium Server

# Load a manifest URL
BOOK=$(echo -n "s3://bookshelf/32941311.epub" |  base64 | tr '/+' '_-' | tr -d '=')
# Should be http://localhost:15080/czM6Ly9ib29rc2hlbGYvMzI5NDEzMTEuZXB1Yg/manifest.json
echo "http://localhost:15080/$BOOK/manifest.json"
curl "http://localhost:15080/$BOOK/manifest.json"

Rebuilding

docker compose -p lenny down
docker compose -p lenny up -d --build

Pilot

We're seeking partnerships with libraries who would like to try lending digital resources to their patrons.

Open Topics

  • Authentication - How does your library perform authentication currently?

About

An open source set of Lending APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •