Skip to main content

A CLI tool to find similar PDF.

Project description

PDF Similarity Matcher

The PDF Similarity Matcher is a command-line tool for finding and displaying PDF documents similar to a given input PDF based on extracted text features. It leverages text extraction and similarity comparison to help you identify relevant matches from a directory of PDFs.

Features

  • Extracts text from PDF files.
  • Processes and compares features from multiple PDFs.
  • Calculates similarity scores between an input PDF and PDFs in the directory.
  • Optionally displays detailed key-value feature information for similar PDFs.

Installation

Follow these steps to install and set up the PDF Similarity Matcher:

  1. Clone the repository:

    git clone https://github.com/yourusername/pdfsim.git
    cd pdfsim
    
  2. Create a virtual environment:

    python3 -m venv venv
    
  3. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate
      
    • On macOS/Linux:

      source venv/bin/activate
      
  4. Install the required packages:

    pip install -r requirements.txt
    

    Ensure requirements.txt includes the necessary libraries:

    PyPDF2
    scikit-learn
    nltk
    

Usage

To find similar PDFs, use the following command:

python3 main.py -d <directory_containing_pdf> -i <input_pdf> -t <top_n> [-kv]

Arguments

  • -d, --database (required): Path to the directory containing PDF files to compare against.
  • -i, --input (required): Path to the input PDF file you want to compare.
  • -t, --top (optional, default: 1): Number of top similar PDFs to display.
  • -kv (optional): Enable detailed key-value feature output for similar PDFs.

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

pdfsim-0.1.tar.gz (2.1 kB view details)

Uploaded Source

File details

Details for the file pdfsim-0.1.tar.gz.

File metadata

  • Download URL: pdfsim-0.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pdfsim-0.1.tar.gz
Algorithm Hash digest
SHA256 b49ff7a74063bd42296d2555a5d0b407f2f4180123fe57bd5fc7b2d4d52c134e
MD5 ef030f51eeed531f7d2b999be81213cf
BLAKE2b-256 bb12f12b3ef057c71f1189641ac642b56d32804b3a058dde69774f10aa484b20

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