Extracting content from spesific address books
Project description
historical-text-extraction (hte)
Package to extract text from historical documents. The package is written for personal use.
Installation
The current release from the PyPI repository:
pip install hte
The development version from GitHub with:
pip install git+ssh://git@github.com/eirikberger/hte.git
Note that it is nessecary with a SSH key for this approach to work.
Using it
Import the package
from hte import digitize
The basic setup is the following:
# Define class
book = digitize.Book("data/finnmark_1968.pdf", "books")
# Run methods on the class
book.CreateFolderStructure()
book.PdfImport(page_info=False, from_page=21, to_page=263)
book.Split(multiple_columns=True)
book.RunOCR(type="splits", export_image=False)
book.CombineCleanGroup(ocr_grouping=True, group_type='norway')
book.RegexStructure("norway")
Make sure to install the correct language package for Tesseract.
# Check languages already installed:
tesseract --list-langs
# Languages available for installation
apt-cache search tesseract-ocr
# Install the Norwegian language pack
sudo apt-get install tesseract-ocr-nor
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hte-0.0.21.tar.gz
(11.7 kB
view details)
Built Distribution
hte-0.0.21-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file hte-0.0.21.tar.gz
.
File metadata
- Download URL: hte-0.0.21.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d516d3ab023c5a2511124a6abbe10164cbf8fa7a99f3fb75aad16f29c2a24c63 |
|
MD5 | 1bc2e5efa30c0fcba761f7c32b6b8a9e |
|
BLAKE2b-256 | bf382dbc363cd37d185535099d52408bc1d6dd31cd9838c423f2d7fe3a8ff94b |
File details
Details for the file hte-0.0.21-py3-none-any.whl
.
File metadata
- Download URL: hte-0.0.21-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 550a47802386282a31214725f1c1651489782496ca02c932d79a0988ba21a2b1 |
|
MD5 | 47e3c5c78ed9dc79d7f2fd093d614437 |
|
BLAKE2b-256 | eae7e45243e1d507f43b16821c181c499c67dcce3e2ce41826b359db0eb8e2a6 |