Skip to main content

Extracting content from spesific address books

Project description

historical-text-extraction (hte)

PyPI version

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


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.19.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

hte-0.0.19-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file hte-0.0.19.tar.gz.

File metadata

  • Download URL: hte-0.0.19.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

Hashes for hte-0.0.19.tar.gz
Algorithm Hash digest
SHA256 cad41b633d39c19f0ea05a459b60237e049ac105427f5d50ab4b0e1ac22da92a
MD5 9b5c6fb40f40fbca75ed5e0446685461
BLAKE2b-256 0867dce78559046ef282c955a5ad94049e00dcd155f6b71a9a80886bde7da60a

See more details on using hashes here.

File details

Details for the file hte-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: hte-0.0.19-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

Hashes for hte-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 4573fa5896564b5fd65d9b115eabdf2498a98cbfa0c9ce80af472b1bb4d45403
MD5 b9441ab07813d68382d950f8b55dcf40
BLAKE2b-256 2240e093d3788264078383b1b739d520914f542241174dd7308772c73806ac50

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page