This project aims to test the conversion, opening files after conversion, and comparing documents.
- Python 3.12
- MS Office 2019
- LibreOffice Community Version: 7.3.0.3
- Python package manager: uv
pip install uv-
MS office settings
- Turn on the dark theme in ms office and in LibreOffice
- In MS PowerPoint change
Options\Advanced\Display\Open all documents using this viewsonNormal - slide only
-
Change config.py file.
- Set environment variables
- version - the document server version (Example: "8.1.0.50")
- source_doc_folder - path to folders with documents before conversion, the folder names must match the file extension (if the file extension in the folder is ".doc", then the folder name must be "doc")
- converted_doc_folder - path to folders with documents after conversion.
The names of folders should have the
form "
<version>_(dir_<extension before conversion> _<extension after conversion>)_(os_<operation system>)_(mode_<Default or t-format>)" Example:8.1.0.50_(dir_xps-docx)_(os_linux)_(mode_Default). - list_of_file_names - array for selective comparison by filename
- Set environment variables
- To send termination reports of the script to Telegram, you need:
- to add 2 environment variables
TELEGRAM_TOKEN- with a token from your bot on telegramCHANNEL_ID- with the channel id on telegram
- or 2 files in the path
~/.telegram:token- with a token from your bot on telegramchat- with the channel id on telegram
- to send messages via proxy, add a file at the path
~/.telegram/proxy.jsoncontaining:
{
"login": "",
"password": "",
"ip": "",
"port": ""
}uv run invoke compare-test - To compare images by file names
from "converted_doc_folder"
--direction or -d - specifies which files to compare.
Example: -d doc-docx to compare doc-docx files.
--telegram or -t - to send reports in a telegram.
--ls or -l - to open files from files_array in config.py
uv run invoke make-files
--telegram or -t - to send reports in a telegram.
--direction or -d - Specifies the direction for converting files.
Example: -d doc-docx
--version or -v - Specifies the version x2t libs.
Example: invoke make-files -v 7.4.0.163
invoke open-test - Running file opening tests
--direction or -d - specifies which files to open.
Example: -d docx to open only docx files. if no required - all
files will be opened
--ls or -l - to open files from files_array in config.py
--path "./path/to/your/folder" - to open files in the specified folder.
--telegram or -t - to send reports in a telegram.
--fast_test or -f - to run tests without taking
into account the tested files
uv run invoke conversion-test
--direction or -d - Specifies the direction for converting files.
Example: -d doc-docx. if not required -
conversion to all formats will be performed.
--ls or -l - to conversion files from files_array in config.py
--telegram or -t - to send reports in a telegram.
--version or -v - Specifies the version x2t libs.
uv run invoke download-core
--version or -v - Specifies the version x2t libs.
uv run invoke download-files
--cores or -c - The amount CPU cores
to use for parallel downloading. (default: None)
uv run invoke s3-upload
--dir-path or -d - The local directory path
containing files to be uploaded.
--cores or -c - The amount CPU cores
to use for parallel downloading. (default: None)