Add enhanced PDF parsing with Student fields and folder organization
This commit is contained in:
1 parent
f265f160cb
commit
87b2b9ad4c
2 files changed
+71
-26
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# PDF Rename Sort
|
||||
|
||||
A Python web application built with Flask that automatically renames PDF files based on form field data extracted from within the PDFs. Designed for batch processing of fillable PDFs, extracting "Last Name" and "First Name" to create standardized filenames.
|
||||
A Python web application built with Flask that automatically renames PDF files based on form field data extracted from within the PDFs and organizes them into a structured folder hierarchy. Designed for batch processing of fillable PDFs, extracting student information and creating organized archives.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -8,8 +8,9 @@ A Python web application built with Flask that automatically renames PDF files b
|
||||
- **Batch Processing**: Handle multiple PDFs or ZIP archives containing PDFs
|
||||
- **Form Field Extraction**: Uses PyPDF2 to read PDF form fields
|
||||
- **Intelligent Renaming**: Renames files to "LastName_FirstName.pdf" format
|
||||
- **Structured Organization**: Creates Episode/School/Grade folder hierarchy
|
||||
- **Duplicate Handling**: Automatically appends counters for duplicate names
|
||||
- **ZIP Support**: Upload ZIP files and download processed results as ZIP
|
||||
- **ZIP Support**: Upload ZIP files and download processed results as ZIP with folder structure
|
||||
- **Job Management**: Background processing with job status tracking and history
|
||||
- **Authentication**: Microsoft Entra ID and local admin login support
|
||||
- **Error Handling**: Gracefully skips files that can't be processed
|
||||
@@ -102,17 +103,31 @@ Users can choose their preferred login method on the login page.
|
||||
|
||||
1. **File Upload**: Accepts PDFs or ZIPs via web form
|
||||
2. **Extraction**: If ZIP, extracts PDFs to temporary directory
|
||||
3. **Processing**: For each PDF, reads form fields using PyPDF2
|
||||
4. **Renaming**: Extracts "Last Name" and "First Name" values
|
||||
5. **Packaging**: Creates a ZIP archive of renamed PDFs
|
||||
6. **Download**: Provides secure download link for results
|
||||
3. **Field Parsing**: For each PDF, reads form fields using PyPDF2:
|
||||
- Student First Name
|
||||
- Student Last Name
|
||||
- Student Grade
|
||||
- Student School
|
||||
4. **Renaming**: Creates filename as "LastName_FirstName.pdf"
|
||||
5. **Organization**: Creates folder structure:
|
||||
```
|
||||
Episode/
|
||||
├── School Name/
|
||||
│ ├── Grade Level/
|
||||
│ │ ├── LastName_FirstName.pdf
|
||||
│ │ └── LastName_FirstName_2.pdf
|
||||
```
|
||||
6. **Packaging**: Creates a ZIP archive preserving the folder structure
|
||||
7. **Download**: Provides secure download link for the organized results
|
||||
|
||||
## Important Notes
|
||||
|
||||
- PDFs must contain fillable form fields named exactly "Last Name" and "First Name"
|
||||
- PDFs must contain fillable form fields named exactly: "Student First Name", "Student Last Name", "Student Grade", and "Student School"
|
||||
- All four fields must be present and filled for the PDF to be processed
|
||||
- Files without these fields or with extraction errors will be skipped
|
||||
- All processing happens server-side with temporary file storage
|
||||
- Maximum upload size is limited to 500MB
|
||||
- Output creates a structured folder hierarchy within the downloaded ZIP
|
||||
|
||||
## Production Deployment
|
||||
|
||||
|
||||
Reference in new issue
Block a user