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.13.tar.gz
(11.6 kB
view details)
Built Distribution
hte-0.0.13-py3-none-any.whl
(11.0 kB
view details)
File details
Details for the file hte-0.0.13.tar.gz
.
File metadata
- Download URL: hte-0.0.13.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9afc991a7ea04fbc7a04d3bf922a53d2730aae7fe998084f24086f2e3e846e1 |
|
MD5 | 5baad80719788d3c82f87a2af6fc9ec6 |
|
BLAKE2b-256 | b3a9d5afe410b467c12d6e514bcbee078bb339e441da0c6e028cde863b088bfa |
File details
Details for the file hte-0.0.13-py3-none-any.whl
.
File metadata
- Download URL: hte-0.0.13-py3-none-any.whl
- Upload date:
- Size: 11.0 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 | 6ecee52d2a34fc32a54c30b041999acbe0503a5233c9deceae599db09aa6a513 |
|
MD5 | c862dbc886ccdd77696a44551ad8c2c4 |
|
BLAKE2b-256 | 2b42d3ed0816e49a5834ef3be57a6fa1b69de2f9f8474867e1e928f9de731d5b |