Python utility that reads ProcessView CSV exports and generates a single normalized Excel workbook for ProtonView.
- Reads every
.csvfile from../SOURCE FILES/. - Keeps the
Keyscolumn plus the language columns that come after it. - Filters out rows whose base language text is empty or contains
UndefinedorUnkown message. - Prefixes each key with the project name taken from the file name.
- Normalizes the language columns across all input files.
- Adds a
ProtonViewcolumn required by the target format. - Writes everything into one workbook:
../EXCEL FILES/AllProjects.xlsx.
Each CSV file must:
- live inside
../SOURCE FILES/ - contain a
Keyscolumn - contain at least one language column after
Keys - use language column names in the format
xx-YY, for exampleen-USores-ES
The project name is taken from the file name before the first underscore.
Example:
AVA_Messages.csv-> project prefixAVA_UFA_Alarms.csv-> project prefixUFA_
- Files with missing or invalid headers are skipped.
- The first language column after
Keysis treated as the base language. - Rows are removed when the base language cell:
- is empty
- contains
Undefined - contains
Unkown message
- The language column
ta-GGis excluded. - If a key is not already prefixed with
<PROJECT>_, the prefix is added automatically. - Missing language columns are backfilled from
en-USwhen available, otherwise from the first available language in that file. - Legacy per-project workbooks such as
AVA.xlsxare removed when the combined workbook is generated.
The script creates:
- workbook:
../EXCEL FILES/AllProjects.xlsx - sheet name:
ProtonView
The generated sheet contains:
ProtonViewKeys- all normalized language columns sorted alphabetically
The ProtonView column is filled with:
ProtonView_Resources_Controllers.IPlcResource
The workbook is written through a temporary file and then replaced atomically. If AllProjects.xlsx is open in Excel, the script stops with a permission error instead of partially overwriting the file.
_Proccesview/
|- SOURCE FILES/
| `- *.csv
|- JSON_Generator/
| |- ExcelGenerator.py
| |- GenerateStrings.bat
| |- README.md
| |- requirements.txt
| `- run_env.py
`- EXCEL FILES/
`- AllProjects.xlsx
Run from the repository folder:
python run_env.pyWindows shortcut:
GenerateStrings.batrun_env.py creates and uses a virtual environment outside the repository folder:
- Windows:
%LOCALAPPDATA%\PythonProjectVenvs\... - Linux/macOS:
$XDG_DATA_HOME/PythonProjectVenvs/...or~/.local/share/PythonProjectVenvs/...
This avoids syncing a local venv through Nextcloud.
If an old in-repo venv still exists, run_env.py warns about it but does not use it.
Main packages:
polars==0.18.14openpyxlxlsx2csv
Install manually if needed:
pip install -r requirements.txtpip install pyinstaller
pyinstaller --onefile --windowed ExcelGenerator.py