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.
Contributing
Run the following instructions after pushing to the repo:
- make html (update documentation - need to be in docs directory)
- update version in setup.py
- python setup.py sdist bdist_wheel (builds the package)
- delete previous versions in dist folder
- twine check dist/* (checks the package)
- 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)
| File | Size | Uploaded | |
|---|---|---|---|
| py-doc-0.1.3.tar.gz | 11.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|