Automated PDF invoice processor that extracts data, maps to SAP format, posts to SAP, and logs the DocEntry to Excel.
No changes needed! Your code is already perfect for .exe distribution. Here's why:
✅ First Run: GUI dialogs automatically prompt users to select folders
✅ Auto-Save: Configuration is saved to monitor_config.json
✅ Future Runs: Uses saved config automatically
You can distribute just the .exe file, and each user configures it for their own system on first run!
- ✅ Code is ready
- ✅ Build scripts created
- ✅ Config system perfect (GUI-based)
- ⏳ Need to build on Windows machine
# Install dependencies
pip install -r requirements.txt pyinstaller
# Build the .exe
build_exe.batOutput: dist\PDF_Monitor.exe (distribute this file!)
Use GitHub Actions to build automatically in the cloud (see WINDOWS_BUILD_GUIDE.md)
What to distribute:
📦 PDF_Monitor.exe (that's it!)
What happens when users run it:
- Double-click
PDF_Monitor.exe - GUI dialogs appear asking for:
- PDF monitoring folder
- Excel output folder
- Log file location
- User selections are saved to
monitor_config.json - Monitoring starts automatically
- Next time they run it, config is loaded automatically
PDF File Detected
↓
Document Extract API (OCR)
↓
Mapping API (Map to SAP format)
↓
SAP Purchase Invoice API (Post invoice)
↓
Capture DocEntry from response
↓
Append to Excel with DocEntry
build_exe.bat- Windows build scriptbuild_exe.sh- Linux build script (creates Linux executable)build_windows_exe.py- Python-based build script
COMPLETE_GUIDE.md- START HERE - Answers all questionsQUICK_START.md- Fast reference guideBUILD_WINDOWS_EXE.md- Detailed build instructionsWINDOWS_BUILD_GUIDE.md- Platform-specific info
monitor_config.json- Auto-created on first runmonitor_config.template.json- Optional template for pre-configuration
- Build the .exe on Windows
- Run
PDF_Monitor.exe - Select folders via GUI dialogs
- Place a test PDF in the monitoring folder
- Check that:
- PDF is processed
- Invoice is posted to SAP
- Excel file is created with DocEntry
- Python 3.8+ (for building only, not for running the .exe)
- Dependencies in
requirements.txt:- watchdog
- requests
- pandas
- openpyxl
Users don't need Python! The .exe is standalone.
- ✅ Automatic PDF monitoring
- ✅ OCR extraction
- ✅ SAP format mapping
- ✅ Automatic SAP posting
- ✅ DocEntry capture and logging
- ✅ Excel output with full invoice data
- ✅ GUI configuration on first run
- ✅ Persistent configuration
- ✅ Daily folder organization
- ✅ Comprehensive logging
- All invoice data fields
- Document lines (item details)
- SAP DocEntry (from posting response)
- Timestamp and file information
The app automatically creates monitor_config.json:
{
"pdf_folder": "C:\\Users\\John\\Desktop\\PDF_Input",
"base_output_folder": "C:\\Users\\John\\Desktop\\Excel_Output",
"log_file": "C:\\Users\\John\\Desktop\\monitor.log"
}You don't create this manually - the GUI dialogs create it!
Q: Do I need to pre-configure paths before building the .exe?
A: No! The .exe will prompt users to select folders on first run.
Q: Can users change the configuration later?
A: Yes! Delete monitor_config.json and run the .exe again.
Q: Why is the .exe large (40-50 MB)?
A: It includes Python and all libraries for standalone operation.
Q: I built on Linux - why didn't I get a .exe?
A: PyInstaller creates executables for the OS you build on. Build on Windows for .exe.
Q: Do I need to include Python with the .exe?
A: No! The .exe is completely standalone.
Q: Will the SAP DocEntry be added to Excel?
A: Yes! The latest code captures DocEntry from the SAP response and adds it as SAP_DocEntry column.
- Build
PDF_Monitor.exeon Windows - Test it on Windows
- Distribute just the .exe file
- Users run it and configure via GUI
- Done!
Users can reconfigure by:
- Deleting
monitor_config.json - Running the .exe again
- Selecting new folders in the GUI dialogs
Ready to build? See COMPLETE_GUIDE.md for step-by-step instructions!