Skip to content

artbitrage/bltools

 
 

Repository files navigation

bltools

**Modern Async Downloader# British Library Tools (bltools)

Python 3.12+ Tests Ruff Checked with mypy License: MIT

A modern, asynchronous CLI tool for downloading high-resolution manuscripts from the British Library. Now with full IIIF (International Image Interoperability Framework) support.

Features

  • Modern Architecture: Built with Typer, Pydantic (settings & models), and HTTPX.
  • IIIF Support: Support for modern IIIF Collection/Manifest URLs.
  • Asynchronous: Concurrent downloads with asyncio and httpx.
  • Robust: Automatic retries with exponential backoff via tenacity.
  • Rich UI: Interactive progress bars and beautiful logging via rich and structlog.
  • 12-Factor Compliant: Configuration via environment variables.

Installation

uv tool install bltools
# or run directly
uv run bltools --help

Using pip

pip install .

Usage

The basic command to download a manuscript:

bltools download add_ms_19352

Options

  • --config, -c: Path to custom config file (default: bl.conf)
  • --output, -o: Override output directory (default: current directory or config setting)
  • --range, -r: Specify a page range (e.g., 1-10)

Examples

Download pages 1 to 5 of a manuscript:

bltools download add_ms_19352 --range 1-5

Save to a specific directory:

bltools download add_ms_19352 --output ./downloads

Configuration

You can use a bl.conf YAML file to set defaults:

sleeptime: 0.0
basedir: "."
rangebegin: 1
rangeend: 259
baseurl: "http://www.bl.uk/manuscripts/Proxy.ashx?view="

Development

This project uses hatchling and uv.

  1. Clone the repo
  2. Install dependencies: uv sync
  3. Run tests: uv run pytest
  4. Lint: uv run ruff check .

About

Tools to download manuscripts from British Library website!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 72.1%
  • Python 13.3%
  • JavaScript 10.8%
  • CSS 3.1%
  • Other 0.7%