Skip to main content

Simple parser and information extractor from PDF documents based on keyword search functionality (powered by Rust)

Project description

PDF Seekers

Simple parser and information extractor from PDF documents based on keyword search functionality (powered by Rust)

Key Features:

  • Indexing capability on single PDF file or directory containing multiple PDF files
  • Search for keywords across multiple PDF files to get relevant information
  • Get number of pages in PDF file, the page numbers containing the search term, and surrounding text aroung the search term

Python

Installation

Install the latest pypdf-seekers version with: pip install pypdf-seekers

Releases happen quite often (weekly / every few days) at the moment, so updating polars regularly to get the latest bugfixes / features might not be a bad idea.

Usage Examples

>>> import pypdf_seekers as ps
>>>        
>>> data_dir = "data"
>>> index_dir = "index"
>>> search_term = "convolutional"
>>> 
>>> ps.indexing_contents(data_dir, index_dir)
[2023-11-21 17:28:09.638890800 UTC] [INFO] data/fast_rcnn.pdf - Indexing completed.
Unicode mismatch true f_i "fi" Ok("fi") [64257]
[2023-11-21 17:28:10.047559300 UTC] [INFO] data/yolo.pdf - Indexing completed.
>>> 
>>> docs = ps.search_term_in_file(data_dir, index_dir, search_term)
[2023-11-21 17:28:38.615366 UTC] [INFO] File Name: data/yolo.pdf
[2023-11-21 17:28:38.659109800 UTC] [INFO] File Name: data/fast_rcnn.pdf
>>> 
>>> for doc in docs:
...     doc.show()
...
[2023-11-21 17:28:54.891329600 UTC] [INFO] Number of pages: 10
[2023-11-21 17:28:54.891675200 UTC] [INFO] Search Term:
[2023-11-21 17:28:54.891952800 UTC] [INFO] Page: 1
[2023-11-21 17:28:54.892267200 UTC] [INFO] Extracted Text: is simple and straightforward. Our system (1) resizes the input image to 448  448 , (2) runs a single convolutional net- work on the image, and (3) thresholds the resulting detections by the model’s condence. methods to rst generate potential
[2023-11-21 17:28:54.892822700 UTC] [INFO] Page: 2
[2023-11-21 17:28:54.893112500 UTC] [INFO] Extracted Text: Our nal prediction is a 7  7  30 tensor. 2.1. Network Design We implement this model as a convolutional neural net- work and evaluate it on the P ASCAL VOC detection dataset [ 9 ]. The initial convolutional layers
[2023-11-21 17:28:54.893647900 UTC] [INFO] Page: 3
[2023-11-21 17:28:54.893911700 UTC] [INFO] Extracted Text: Figure 3: The Architecture. Our detection network has 24 convolutional layers followed by 2 fully connected layers. Alternating 1  1 convolutional layers reduce the features space from preceding layers.
[2023-11-21 17:28:54.894457600 UTC] [INFO] Page: 4
[2023-11-21 17:28:54.894790700 UTC] [INFO] Extracted Text: a set of robust features from input images (Haar [ 25 ], SIFT [ 23 ], HOG [ 4 ], convolutional features [ 6 ]). Then, classiers [ 36 ,  21 ,  13 ,  10 ] or localizers
[2023-11-21 17:28:54.895406600 UTC] [INFO] Page: 5
[2023-11-21 17:28:54.895713500 UTC] [INFO] Extracted Text: 14 ]. YOLO shares some similarities with R-CNN. Each grid cell proposes potential bounding boxes and scores those boxes using convolutional features. However, our system puts spatial constraints on the grid cell proposals which helps mitigate multiple detections of the same
[2023-11-21 17:28:54.896272 UTC] [INFO] Page: 9
[2023-11-21 17:28:54.896602900 UTC] [INFO] Extracted Text: [6]  J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. Decaf: A deep convolutional acti- vation feature for generic visual recognition. arXiv preprint arXiv:1310.1531 , 2013.  4 [7]  J. Dong, Q. Chen,
[2023-11-21 17:28:54.897219100 UTC] [INFO] Number of pages: 9
[2023-11-21 17:28:54.897568200 UTC] [INFO] Search Term:
[2023-11-21 17:28:54.897864500 UTC] [INFO] Page: 1
[2023-11-21 17:28:54.898179 UTC] [INFO] Extracted Text: method (Fast R-CNN) for object detection. Fast R-CNN builds on previous work to efciently classify ob- ject proposals using deep convolutional networks. Com- pared to previous work, Fast R-CNN employs several in- novations to improve training and testing speed while also
[2023-11-21 17:28:54.898804400 UTC] [INFO] Page: 2
[2023-11-21 17:28:54.899129 UTC] [INFO] Extracted Text: are also written to disk. But unlike R-CNN, the ne-tuning al- gorithm proposed in [ 11 ] cannot update the convolutional layers that precede the spatial pyramid pooling. Unsurpris- ingly, this limitation (xed convolutional layers) limits the accuracy of very deep
[2023-11-21 17:28:54.899753900 UTC] [INFO] Page: 9
[2023-11-21 17:28:54.900076400 UTC] [INFO] Extracted Text: 2009.  2 [5]  E. Denton, W. Zaremba, J. Bruna, Y. LeCun, and R. Fergus. Exploiting linear structure within convolutional networks for efcient evaluation. In NIPS , 2014.  4 [6]  D. Erhan, C. Szegedy, A. Toshev, and D.

Rust

You can take latest release from crates.io, or if you want to use the latest features / performance improvements point to the main branch of this repo.

Run the following Cargo command in your project directory: cargo add pdf_seekers

Or add the following line to your Cargo.toml: pdf_seekers = "0.1.1"

Usage Examples

cargo run -- --action ACTION --file-or-directory FILE_OR_DIRECTORY --index-path INDEX_PATH

Options:

  • -a, --action: Action to be performed [index, search]
  • -f, --file-or-directory: Provide single PDF file to be searched, or directory path containing multiple PDF files
  • -i, --index-path: Directory path where all indexed files will be stored
  • -s, --search-term: Keyword to be searched in PDF files (only required when action=Searching)
  • -h, --help: Print help
  • -V, --version: Print version

Indexing Command

$ cargo run -- -a index -i index_dir -f data
[2023-11-21 17:34:10.144023300 UTC] [INFO] data/fast_rcnn.pdf - Indexing completed.
Unicode mismatch true f_i "fi" Ok("fi") [64257]
[2023-11-21 17:34:11.833275200 UTC] [INFO] data/yolo.pdf - Indexing completed.

Search Command

$ cargo run -- -a search -i index_dir -f data -s convolutional
[2023-11-21 17:34:20.866758200 UTC] [INFO] File Name: data/yolo.pdf
[2023-11-21 17:34:21.343954600 UTC] [INFO] File Name: data/fast_rcnn.pdf
[2023-11-21 17:34:21.344466100 UTC] [INFO] Number of pages: 10
[2023-11-21 17:34:21.344723100 UTC] [INFO] Search Term:
[2023-11-21 17:34:21.344943300 UTC] [INFO] Page: 1
[2023-11-21 17:34:21.345155900 UTC] [INFO] Extracted Text: is simple and straightforward. Our system (1) resizes the input image to 448  448 , (2) runs a single convolutional net- work on the image, and (3) thresholds the resulting detections by the model’s condence. methods to rst generate potential
[2023-11-21 17:34:21.345686100 UTC] [INFO] Page: 2
[2023-11-21 17:34:21.346109200 UTC] [INFO] Extracted Text: Our nal prediction is a 7  7  30 tensor. 2.1. Network Design We implement this model as a convolutional neural net- work and evaluate it on the P ASCAL VOC detection dataset [ 9 ]. The initial convolutional layers
[2023-11-21 17:34:21.346702900 UTC] [INFO] Page: 3
[2023-11-21 17:34:21.347033100 UTC] [INFO] Extracted Text: Figure 3: The Architecture. Our detection network has 24 convolutional layers followed by 2 fully connected layers. Alternating 1  1 convolutional layers reduce the features space from preceding layers.
[2023-11-21 17:34:21.347782300 UTC] [INFO] Page: 4
[2023-11-21 17:34:21.348105600 UTC] [INFO] Extracted Text: a set of robust features from input images (Haar [ 25 ], SIFT [ 23 ], HOG [ 4 ], convolutional features [ 6 ]). Then, classiers [ 36 ,  21 ,  13 ,  10 ] or localizers
[2023-11-21 17:34:21.348597800 UTC] [INFO] Page: 5
[2023-11-21 17:34:21.348833700 UTC] [INFO] Extracted Text: 14 ]. YOLO shares some similarities with R-CNN. Each grid cell proposes potential bounding boxes and scores those boxes using convolutional features. However, our system puts spatial constraints on the grid cell proposals which helps mitigate multiple detections of the same
[2023-11-21 17:34:21.349386700 UTC] [INFO] Page: 9
[2023-11-21 17:34:21.349679500 UTC] [INFO] Extracted Text: [6]  J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. Decaf: A deep convolutional acti- vation feature for generic visual recognition. arXiv preprint arXiv:1310.1531 , 2013.  4 [7]  J. Dong, Q. Chen,
[2023-11-21 17:34:21.350348900 UTC] [INFO] Number of pages: 9
[2023-11-21 17:34:21.350626500 UTC] [INFO] Search Term:
[2023-11-21 17:34:21.350912500 UTC] [INFO] Page: 1
[2023-11-21 17:34:21.351197200 UTC] [INFO] Extracted Text: method (Fast R-CNN) for object detection. Fast R-CNN builds on previous work to efciently classify ob- ject proposals using deep convolutional networks. Com- pared to previous work, Fast R-CNN employs several in- novations to improve training and testing speed while also
[2023-11-21 17:34:21.352050100 UTC] [INFO] Page: 2
[2023-11-21 17:34:21.352867100 UTC] [INFO] Extracted Text: are also written to disk. But unlike R-CNN, the ne-tuning al- gorithm proposed in [ 11 ] cannot update the convolutional layers that precede the spatial pyramid pooling. Unsurpris- ingly, this limitation (xed convolutional layers) limits the accuracy of very deep
[2023-11-21 17:34:21.353819600 UTC] [INFO] Page: 9
[2023-11-21 17:34:21.354126600 UTC] [INFO] Extracted Text: 2009.  2 [5]  E. Denton, W. Zaremba, J. Bruna, Y. LeCun, and R. Fergus. Exploiting linear structure within convolutional networks for efcient evaluation. In NIPS , 2014.  4 [6]  D. Erhan, C. Szegedy, A. Toshev, and D.

Official Repository:

Visit the PDF Seeker official repository for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pypdf_seekers-0.1.2-cp312-none-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pypdf_seekers-0.1.2-cp312-none-win32.whl (2.5 MB view details)

Uploaded CPython 3.12Windows x86

pypdf_seekers-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

pypdf_seekers-0.1.2-cp312-cp312-macosx_10_7_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.12macOS 10.7+ x86-64

pypdf_seekers-0.1.2-cp311-none-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pypdf_seekers-0.1.2-cp311-none-win32.whl (2.5 MB view details)

Uploaded CPython 3.11Windows x86

pypdf_seekers-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

pypdf_seekers-0.1.2-cp311-cp311-macosx_10_7_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11macOS 10.7+ x86-64

pypdf_seekers-0.1.2-cp310-none-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pypdf_seekers-0.1.2-cp310-none-win32.whl (2.5 MB view details)

Uploaded CPython 3.10Windows x86

pypdf_seekers-0.1.2-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pypdf_seekers-0.1.2-cp310-cp310-macosx_10_7_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.10macOS 10.7+ x86-64

pypdf_seekers-0.1.2-cp39-none-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pypdf_seekers-0.1.2-cp39-none-win32.whl (2.5 MB view details)

Uploaded CPython 3.9Windows x86

pypdf_seekers-0.1.2-cp38-none-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8Windows x86-64

pypdf_seekers-0.1.2-cp38-none-win32.whl (2.5 MB view details)

Uploaded CPython 3.8Windows x86

File details

Details for the file pypdf_seekers-0.1.2-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 6dcdf155cdb60730be81f3a30cfdb1fc1c04737687eae848dc2e9a6d97fb7735
MD5 ac9b550568827da42b95ce10debfc3ea
BLAKE2b-256 4c04993f7a74cfa6ce2f13c5f1e400097266df727687471a7e17b9f072b29e23

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp312-none-win32.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp312-none-win32.whl
Algorithm Hash digest
SHA256 c9dd021ffbcd5e30c7c3bf1ddd4da92c35009b5ea416c64c72c8a3a39f4977e5
MD5 bbd17f01ecd590d0ca8e86ebd75c1205
BLAKE2b-256 10273713c4b70909ddbca18079b48c77a07395760b5b100e4fafaa08f37a7e26

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 07289b08cfd4cec6f97bbaaa51be631daf7bef69f8ec88df438b140127832538
MD5 bcc94e081bf5760791554573f50c197a
BLAKE2b-256 3dba12d2e1c7e97a9818b8852d85c9ca6f04270f4bf05987e760618b0c96725d

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp312-cp312-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp312-cp312-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fc207901387ed456860984d115cd7606500844372a9c9b0f0a3c5c584b1a007c
MD5 9c72aabb11866c16d7d18fbb9bffc14b
BLAKE2b-256 5bacb6f7b16539aef805d3f3fb278cfdab7c932b30ea5a443ceddef330abfbd6

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 241ba81f794f0958cef80c17f037a10fe923e266d7cac9dc86e2bf3e65aff26d
MD5 4c848f8123bca3668fe7e22b15a1c7f8
BLAKE2b-256 d32e51279171e5e3444599023a2b9d30e6afcf647ec542ce5d63c8d68ff5dba5

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp311-none-win32.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp311-none-win32.whl
Algorithm Hash digest
SHA256 34fb2bedcc839ed8c43e3eea216a3162de665fe0ace416d9b7769e084f6a786b
MD5 697ace3fab93043e82e7ecf9e54c8999
BLAKE2b-256 225522913486091c03ebb608a667f84a9b7a98dc0653a156c9719d700e3d7a6e

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d45808a0a27367e5176da583c97a46c73f45846502ab42d887a4c5a96cc0d62f
MD5 6cd0b2f23fee9a9f2bc57cabec282dc4
BLAKE2b-256 b33049c41459d1655a60a72cf91a0f9bffc773b13a5372e9edceb3d024b580f7

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp311-cp311-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 466ef79510e616695ce0a681d008c12ce57edf82500b23ffb8c0a33bddf56627
MD5 7e1bd77c5882a9e62a364d3141bf1bcb
BLAKE2b-256 e205eb45d87836b757afb7edecb8f3510562f240870fabed0578b0ebd2aae207

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 9f528fbb7b353a64876fa13793c0226074321a75480c4f5198f94ded075ea541
MD5 f1a78eff5198da15b52d25962b0ef790
BLAKE2b-256 50ef256c8aa0993541c729c8d40f82438cfd810ee1a8ab693b95344fb59e1a08

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp310-none-win32.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp310-none-win32.whl
Algorithm Hash digest
SHA256 a1ccc76b6498e909a0ae94a39804282de63282f1ca858088100de4d0c2408a9b
MD5 f4a5a492f66a5a42846ac2cbdcdea21c
BLAKE2b-256 34ed60b5f2711e397cb9bd7f5aa078d11b9f5858e41f03fa115319d615fc2f05

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2039f6db79f3ce4718483a622aa229ccde23e76a8359d9f14070d2fb56d3dd7
MD5 f4c9c0120df9633868c54ae75628651f
BLAKE2b-256 5ec2ff4ab194e9723168ba096c510f5d7f40d5bb9aee5f91b659a0316fd13870

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp310-cp310-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 caebc98aad32fdfa1b8fd73351183d1be5985f5b56c62376fc1d88b49593359c
MD5 fc87b108801624c333ef8a6cfece1378
BLAKE2b-256 3f187e571b1aea56d51b89d2aca3ae9acb39b3792225a429bfab1ffce1fe99ac

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 7bb8d56dd327e79ccaafc69b68529c16d4975a314c0397dd5756980aefe134df
MD5 104bd61aa124396f9afd57750b2ff10d
BLAKE2b-256 f759a1db30aca7aeb971020868bddbde146d7301d2526741ac6c698bb243511a

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp39-none-win32.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp39-none-win32.whl
Algorithm Hash digest
SHA256 72afbc88ebc3edcb6fe31f4ce4afd236b29274c692a2d8af9e48fb6926b0549f
MD5 d9a80a1bb93acb64dd74faf157f3ce0f
BLAKE2b-256 cfa1ab48ef6031d6ae9040eaab0e88916b03e3e2e73df91ba170aa5dfeb95b90

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 1cb8a9670921b7a2c949563b8e22ec44a8923be14006dc42b68bf9c873e4530b
MD5 7c2441a0fcd78c76286f38d2e3b91210
BLAKE2b-256 a9408bb70858f90215fd0d307965be97e559c0dc7e818463a3d58c9fbd7ac0df

See more details on using hashes here.

File details

Details for the file pypdf_seekers-0.1.2-cp38-none-win32.whl.

File metadata

File hashes

Hashes for pypdf_seekers-0.1.2-cp38-none-win32.whl
Algorithm Hash digest
SHA256 9e5b263bf4991d54a9512bc0eaad69f7173c8265077a2961316d480f6f588998
MD5 72355788c3f815a2837ba5e67cdb6930
BLAKE2b-256 7844dd45c77b5e2302b895d0b40c808afa573cd952b0b80398c3a36138059cb1

See more details on using hashes here.

Supported by

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