cneud/alto-tools

Python tools for performing various operations on ALTO XML files

50

stars

202

commits

Python

primary language

Jun 12, 2026

updated

alto-xml
digital-library
optical-character-recognition

README

ALTO Tools

Python tools for performing various operations on ALTO XML files


Installation

You can install from PyPI by running

pip install alto-tools

or clone the repository, enter it and run

pip install .

Usage

alto-tools <INPUT> [OPTION] 

INPUT should be the path to an ALTO xml file or directory containing ALTO xml files.

To pipe the output of another command into alto-tools, pass the path - as the INPUT argument, e.g.

cat tests/data/PPN720183197-PHYS_0004.xml | alto-tools -t -

The following OPTIONS are currently supported:

OPTIONDescription
-t --textExtract UTF-8 encoded text content
-c --confidenceExtract mean OCR word confidence score
-i --illustrationsExtract bounding box coordinates of <Illustration> elements
-g --graphicsExtract bounding box coordinates of <GraphicalElement> elements
-s --statisticsExtract statistical info (no. of textlines, words, glyphs etc.)

All output is sent to stdout.

Contributors

cneud

172 commits

JKatzwinkel

13 commits

mikegerber

9 commits

drzraf

3 commits

cneud/alto-tools

Python tools for performing various operations on ALTO XML files

50

stars

202

commits

Python

primary language

Jun 12, 2026

updated

alto-xml
digital-library
optical-character-recognition

README

ALTO Tools

Python tools for performing various operations on ALTO XML files


Installation

You can install from PyPI by running

pip install alto-tools

or clone the repository, enter it and run

pip install .

Usage

alto-tools <INPUT> [OPTION] 

INPUT should be the path to an ALTO xml file or directory containing ALTO xml files.

To pipe the output of another command into alto-tools, pass the path - as the INPUT argument, e.g.

cat tests/data/PPN720183197-PHYS_0004.xml | alto-tools -t -

The following OPTIONS are currently supported:

OPTIONDescription
-t --textExtract UTF-8 encoded text content
-c --confidenceExtract mean OCR word confidence score
-i --illustrationsExtract bounding box coordinates of <Illustration> elements
-g --graphicsExtract bounding box coordinates of <GraphicalElement> elements
-s --statisticsExtract statistical info (no. of textlines, words, glyphs etc.)

All output is sent to stdout.

Contributors

cneud

172 commits

JKatzwinkel

13 commits

mikegerber

9 commits

drzraf

3 commits

Languages

Python

100.0%