A comprehensive web-based system for generating professional valve inspection and service reports with image support, Excel data integration, and PDF management.
- Web-based Interface: Modern, responsive web application built with Flask
- Dual Report Types: Service Reports and Received Reports with different layouts
- Excel Data Integration: Upload Excel files or use existing extracted data
- Professional PDF Generation: Clean, structured reports with company branding
- Image Management: Upload, preview, and delete images with drag-and-drop support
- PDF Management: View, download, and delete generated PDFs
- Multiple Image Support: Upload up to 3 "AS RECEIVED VALVE" images + 4 detailed images
- Service Options: Select multiple service types (In-situ Testing, Service & Repair, Testing Only, Replace New Valve)
- Custom Client Information: Override default values with custom client data
- Stamp System: Add digital stamps with prepared by information and dates
- Mobile Responsive: Works seamlessly on desktop and mobile devices
- Real-time Preview: Image previews with delete functionality
- Auto-cleanup: Automatic cleanup of temporary files after PDF generation
- Python 3.8 or higher
- pip (Python package installer)
- Modern web browser (Chrome, Firefox, Safari, Edge)
git clone <repository-url>
cd valverec
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate
pip install -r requirements.txt
Ensure you have the following files in your project directory:
extracted_data.json
(will be created when you upload Excel)petronas.png
(company logo)stamp/sao.png
(stamp image)
python recweb.py
Open your browser and navigate to:
http://localhost:5300
- Upload Excel Data: Upload your valve data Excel file or use existing data
- Enter Work Order: Search by Work Order (WO) number
- Upload Images: Add valve images (optional)
- Customize Information: Modify client details if needed
- Generate PDF: Click "Generate PDF" to create your report
- Visual Inspection: Internal parts inspection table
- Internal Inspection: Detailed component inspection
- Service Options: Multiple service type selections
- Professional Layout: Clean, structured format
- Transportation Details: Transport mode, packaging, received by
- Valve Condition: Overall condition assessment
- Detailed Pictures: 4-image grid layout
- AS Received Images: Up to 3 valve condition images
- JPEG (.jpg, .jpeg)
- PNG (.png)
- GIF (.gif)
- Drag & Drop: Easy image upload
- Real-time Preview: See images before PDF generation
- Delete Functionality: Remove uploaded images with red Γ button
- Mobile Camera: Take photos directly on mobile devices
- Auto-cleanup: Temporary images removed after PDF generation
-
AS RECEIVED VALVE Images (up to 3)
- Overall valve condition photos
- Before-service documentation
-
Detailed Images (4 specific types)
- Inlet Connection
- Outlet Connection
- Defect Connection (if any)
- Defect on Body (if any)
- View: Open PDFs directly in browser
- Download: Download PDFs to your device
- Delete: Remove unwanted PDFs with confirmation
- List: Browse all generated reports
- Excel Upload: Upload new valve data
- Existing Data: Use previously extracted data
- Auto-extraction: Excel data automatically converted to JSON
Customize the following fields:
- Client Name
- Project Name
- Location
- Date In
- Transport Mode
- Transport By
- Packaging
- Received By
- Inlet/Outlet Types
- Connection Conditions
- Valve Body Condition
- Overall Valve Condition
Select multiple service types:
- β In-situ Testing
- β Service & Repair
- β Testing Only
- β Replace New Valve
- Digital Stamps: Add prepared by information
- Date Stamps: Include generation dates
- Customizable: Modify stamp details
Create a .env
file for custom configuration:
FLASK_ENV=development
UPLOAD_FOLDER=static/temp_images
PDF_FOLDER=generated_pdfs
valverec/
βββ recweb.py # Main Flask application
βββ servicerep.py # Service report generator
βββ recievedreport.py # Received report generator
βββ extract_excel_to_json.py # Excel data extractor
βββ templates/
β βββ index.html # Web interface
βββ static/
β βββ temp_images/ # Temporary uploaded images
β βββ temp_excel/ # Temporary Excel files
βββ generated_pdfs/ # Generated PDF reports
βββ stamp/ # Stamp images
βββ requirements.txt # Python dependencies
# Build the Docker image
docker build -t valve-report-generator .
# Run the container
docker run -p 5300:5300 valve-report-generator
- Responsive Design: Optimized for mobile screens
- Touch-friendly: Large buttons and touch targets
- Camera Integration: Take photos directly with device camera
- Mobile Upload: Easy file selection on mobile devices
- Open web app on mobile browser
- Upload Excel data or use existing
- Enter Work Order number
- Tap image fields to take photos
- Generate PDF report
- Download or view generated report
GET /
- Main web interfacePOST /upload-excel
- Upload Excel dataPOST /upload-image
- Upload valve imagesPOST /generate
- Generate PDF reportGET /list-pdfs
- List generated PDFsGET /download-pdf/<filename>
- Download PDFGET /view-pdf/<filename>
- View PDF in browserDELETE /delete-pdf/<filename>
- Delete PDFPOST /cleanup-temp
- Clean temporary files
GET /available-no
- Get available Work Order numbers
- File Type Validation: Only allowed image types
- Secure Filenames: Prevents path traversal attacks
- Size Limits: Prevents large file uploads
- Auto-cleanup: Temporary files automatically removed
- Filename Validation: Prevents directory traversal
- Confirmation Dialogs: Prevents accidental deletions
- Error Handling: Graceful error management
1. Port Already in Use
# Change port in recweb.py
app.run(debug=True, port=5301, host='0.0.0.0')
2. Missing Dependencies
pip install -r requirements.txt
3. Excel Upload Fails
- Ensure Excel file is .xlsx or .xls format
- Check file is not corrupted
- Verify file permissions
4. Image Upload Issues
- Check image format (JPG, PNG, GIF)
- Ensure image file is not corrupted
- Verify file size is reasonable
5. PDF Generation Errors
- Check Work Order number exists in data
- Verify all required fields are filled
- Check server logs for detailed errors
Enable debug mode for detailed error messages:
app.run(debug=True, port=5300, host='0.0.0.0')
- Image Compression: Compress images before upload
- Batch Processing: Generate multiple reports efficiently
- Cleanup: Regularly clean temporary files
- Browser Cache: Clear browser cache if issues occur
- Regular Backups: Backup generated PDFs
- Data Validation: Verify Excel data before upload
- Image Quality: Use high-quality images for better reports
- File Management: Regularly delete old PDFs
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Follow PEP 8 Python style guide
- Add comments for complex logic
- Include error handling
- Write descriptive commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Check this README first
- Issues: Report bugs via GitHub Issues
- Questions: Ask questions in GitHub Discussions
For support or questions:
- Create an issue on GitHub
- Check the troubleshooting section
- Review the code comments
- β Web-based interface
- β Image upload and management
- β PDF generation and management
- β Excel data integration
- β Mobile responsive design
- β Delete functionality for images and PDFs
- β Professional report layouts
- β Basic PDF generation
- β Simple report templates
- β Image support
Made with β€οΈ for professional valve inspection reporting