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.12.tar.gz
(11.7 kB
view details)
Built Distribution
hte-0.0.12-py3-none-any.whl
(11.1 kB
view details)
File details
Details for the file hte-0.0.12.tar.gz
.
File metadata
- Download URL: hte-0.0.12.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 | 4fbdd1406e5ecf34388dc92dac0b7fa6ae15bd413d7dec05dc925df2e007d6ac |
|
MD5 | 605c49290de8304acafe98f22ce03c84 |
|
BLAKE2b-256 | c86f7dfe1dcb97030dfa640156a174df1a3dd6b2bdb523d1210a87e8ce466c67 |
File details
Details for the file hte-0.0.12-py3-none-any.whl
.
File metadata
- Download URL: hte-0.0.12-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 | 5ede9315c18b93767ab9a1f9a35bfbbc18412e204dbe82539ee4538fcec6943b |
|
MD5 | 6485d7dceff594fc1ae7c320d9220a50 |
|
BLAKE2b-256 | 7607c4a157db0a029fe02c8eb666faa61339da8801b2b98d934f0297cb33f48f |