No description
Created comprehensive metadata_importer.py module:
- CSV import with multiple encoding support (UTF-8, Latin1, ISO-8859-1, CP1252)
- Excel import (.xlsx, .xls) with sheet selection
- JSON import (object and array formats)
- Intelligent column detection for filename, title, subject, keywords
- Fuzzy column matching (case-insensitive, multiple aliases)
- Metadata normalization to standard format
- Import validation with statistics
- File lookup by filename stem (case-insensitive)
Web interface enhancements:
- /import-metadata endpoint for file uploads
- Import section UI (appears when Import source selected)
- Real-time import statistics display (records, title/subject/keywords counts)
- Import session management with unique session IDs
- Visual feedback (active state, success/error messages)
- Validation: requires import file before processing with import source
Import workflow:
1. User selects "Import from File" metadata source
2. Import section appears with file chooser
3. User uploads CSV/Excel/JSON with metadata
4. System validates and shows statistics
5. User uploads files to process
6. System matches files to imported metadata by filename
Supported import formats:
- CSV: filename, title, subject/description, keywords columns
- Excel: Any sheet with filename and metadata columns
- JSON: {filename: {metadata}} or [{filename, metadata}] formats
Technical features:
- Pandas DataFrame parsing for CSV/Excel
- Flexible column name detection (10+ aliases per field)
- NaN/null value handling
- List/array keyword support
- Unicode filename support
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
||
|---|---|---|
| docs | ||
| src | ||
| templates | ||
| .gitignore | ||
| README.md | ||
| requirements.txt | ||
| run_gui.py | ||
| web_app.py | ||
Oliver Metadata Tool
Universal metadata creation and management tool for all file types. Create, import, and manage metadata from multiple sources with an intuitive web interface.
Features
- Excel-based metadata lookup: Reads metadata from "Celum ID to Adobe Asset Path Mapping Spreadsheet"
- Multi-format support: PDF, images (JPG, PNG, etc.), Office documents (Word, Excel, PowerPoint), video files
- Unicode support: Full support for Chinese, Japanese, Korean characters (CGA region)
- OCR capabilities: Multi-language text extraction with Tesseract
- Web interface: Flask-based UI for easy batch processing
- Dual-sheet Excel lookup: Primary lookup from DSB sheet, fallback to Medsurg sheet
Requirements
- Python 3.8+
- Tesseract OCR (for image text extraction)
- Poppler (for PDF processing)
- ExifTool 12.15+ (recommended - enables 300+ file formats and improved performance)
Installation
- Install system dependencies:
# macOS
brew install tesseract tesseract-lang poppler exiftool
# Linux (Ubuntu/Debian)
sudo apt-get install tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-chi-tra tesseract-ocr-jpn tesseract-ocr-kor poppler-utils libimage-exiftool-perl
Note: ExifTool is optional but highly recommended. It provides:
- Support for 300+ file formats
- 10-60x faster batch operations
- Better PDF metadata writing
- See docs/EXIFTOOL_SETUP.md for detailed setup instructions
- Create virtual environment and install Python packages:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
- Set up environment variables (create
.envfile):
UPLOAD_FOLDER=uploads
OUTPUT_FOLDER=output
TESSERACT_PATH=/opt/homebrew/bin/tesseract
OCR_LANGUAGES=eng+chi_sim+chi_tra+jpn+kor
Usage
Web Interface
python web_app.py
Open browser at http://localhost:5001
GUI Application
python run_gui.py
Excel Data Structure
The tool reads metadata from Excel file with two sheets:
Sheet 1: DSB Celum ID to Path mapping (Primary)
- Column B: Celum ID
- Column E: Title
- Column F: External Description/Alt Text
Sheet 2: Medsurg Metadata Cheat (Fallback)
- Column: Solventum DAM Asset Path (contains filename)
- Metadata columns for Title and Description
Lookup is performed by filename (without extension), case-insensitive.
Architecture
web_app.py- Flask web applicationrun_gui.py- GUI launchersrc/- Core modulesextractors/- Content extraction for different file typesupdaters/- Metadata update for different file typesexcel_metadata_lookup.py- Excel-based metadata lookupmain.py- Core processing logicconfig.py- Configuration management
License
Proprietary - Solventum