Skip to main content

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

Uploaded Source

Built Distribution

hte-0.0.1-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hte-0.0.1.tar.gz
  • Upload date:
  • Size: 11.3 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.1.tar.gz
Algorithm Hash digest
SHA256 3484308115b95c48580c79587f2db09465e8bfad156e9f4ba555ef7717bdbc29
MD5 8ddd3555684140d5d2f445aaf0f00bc1
BLAKE2b-256 2815e61a4cf679243c4c0e0d348780af804d71a7dc59fd30225589831a3c7393

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hte-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98884a1bc07f5c08218a05eac5cff9350edef4bfff825e7dbb7c04a813e2ae1a
MD5 4895f2111e2627498f70af099c97c263
BLAKE2b-256 692be0baa2fa6878d9ede5a5d9a7122fa3c93177805fde97a3444cdc3eebb420

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