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

Uploaded Source

Built Distribution

hte-0.0.10-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hte-0.0.10.tar.gz
  • Upload date:
  • Size: 11.5 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.10.tar.gz
Algorithm Hash digest
SHA256 92f6638193e462661590d10f90ebc882961623b248cdca3875c525de522d923f
MD5 d618593c5018e8c39eeee11ba28611e9
BLAKE2b-256 65a44fd42a2ab011c46e2c56968c9e21c8023c05b3e1a7a42bbb1aa929f72afc

See more details on using hashes here.

File details

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

File metadata

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

Hashes for hte-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 946d80e0fbae128c7c8ee2132014a7892c3ba159cc35cd3bdc9d12dc26e32052
MD5 133e665122fce2511ba2e628fc559eff
BLAKE2b-256 6058cdc35661baefc65685893f0d791124281f9e3d4b6e1c8d87a5327ecdd799

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