Analyzes PDF documents, extracts structured information, groups similar documents, and identifies the most recent version.
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Analyze PDFs in current directory
python main.py
# Analyze PDFs in specific directory
python main.py /path/to/pdfs
# Specify output file
python main.py /path/to/pdfs -o output.json
# Verbose mode
python main.py /path/to/pdfs -v-> Extracts revision dates, numbers, paragraphs, and images from PDFs -> Groups similar documents together -> Identifies the most recent/authoritative version -> Outputs structured JSON with all findings
{
"groups": [
{
"groupId": "A",
"documents": [
{
"fileName": "Document1.pdf",
"revisionDate": "12/15/2024",
"revisionNumber": "2.1",
"paragraphs": [
{"title": "Paragraph 1", "text": "..."}
],
"images": [
{"exists": true}
]
}
],
"isIdentical": false
}
]
}pytest