Skip to main content

PyDoc

A library for interacting with pdf documents.

Installation

pip install py-doc

Get Started

How to use the library:

from py_doc import Image 

# Instantiate a Document object 
image = Image('path/to/image.jpg')

# Use draw_classifications to find document classifications
image.draw_classifications("outupt.jpg")

# Additionally, if you just want the bounding boxes use get_bounding_box()
image.get_bboxes()

To do optical character recognition (OCR), you will need to install Tesseract on your machine and make sure it is added to your PATH. If you don't need OCR, you can skip this step.

from py_doc import Image
image = Image('path/to/image.jpg')

# Use get_text() to get all the text from the image
print(image.get_text())

# Use get_text_from_bbox() to get text from a specific bounding box
bbox = image.get_bboxes()[0]
print(image.get_text_from_bbox(bbox))

Documentation

The documentation for this library can be found here.

Examples

This image is a sample of the output of the draw_classifications() method. The bounding boxes are drawn around the document classifications. Sample Output

Contributing

Run the following instructions after pushing to the repo:

  1. make html (update documentation - need to be in docs directory)
  2. update version in setup.py
  3. python setup.py sdist bdist_wheel (builds the package)
  4. delete previous versions in dist folder
  5. twine check dist/* (checks the package)
  6. twine upload dist/* (uploads the package to PyPi)

Metadata

Release files for py-doc 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-doc 0.1.3
File Size Uploaded
py-doc-0.1.3.tar.gz 11.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-doc 0.1.3
File Interpreter ABI Platform
py_doc-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 MB

Release files / py-doc-0.1.3.tar.gz

Download URL py-doc-0.1.3.tar.gz
Size 11.4 MB
Tags Source
SHA-256 checksum
How to use checksums
97b525247177e1829ec1895f151015e55c4e57a86749121f60e9bd5d7bf485bc
BLAKE2b-256 checksum
How to use checksums
f0705658b7c9436032fd5a1e3721c56a2337a4ef1ea6e371ed9c06d3dc9420e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / py_doc-0.1.3-py3-none-any.whl

Download URL py_doc-0.1.3-py3-none-any.whl
Size 11.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
73786ece3bc019a4b3942135251a939fe5a8ee02141c9fbb68f8b603fee3a092
BLAKE2b-256 checksum
How to use checksums
fae9483e7b0d4a02d3cd660a8a3dbaffff41d10a912d246a0c5f8f5fd1ba60c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page