A simple script to convert contents of a word doc to renpy text format.
Use for renpy version 8.3.2
Ensure you have atleast python version 3.12.6
- Create virtual environment
python3 -m venv venv
- Source virtual environment.
Sourcing for a specific OS here
Linux/MacOS
source venv/bin/activate
Windows
venv/Scripts/activate.bat
- Install requirements
pip install -r requirements.txt
To run the gui
source venv/bin/activate
python index.py
Make sure you are sourced into your virtual environment
- Place word documents in
./quick_convert_data/docx
directory - Run quick conversion
python index.py --quick_convert
- Converted .rpy file should be the in
./quick_convert_data/renpy
directory
Okay, how do I install it on other people's machine without downloading it. We can build with pyinstaller by constructing the binary files.
Resource for --add-data here
Linux/MacOS
pyinstaller index.py \
--collect-data sv_ttk \
--add-data="./gui/assets/*.png:./gui/assets/" \
--add-data="./quick_convert_data/docx/*:./quick_convert_data/docx/" \
--add-data="./quick_convert_data/renpy/*:./quick_convert_data/renpy/" \
--windowed \
--name doc_to_renpy
Windows (Powershell)
pyinstaller index.py `
--collect-data sv_ttk `
--add-data="./gui/assets/*.png;./gui/assets/" `
--add-data="./quick_convert_data/docx/*;./quick_convert_data/docx/" `
--add-data="./quick_convert_data/renpy/*;./quick_convert_data/renpy/" `
--windowed `
--name doc_to_renpy
You can run it by calling the binary file
{{path_to_repo}}/dist/doc_to_renpy/doc_to_renpy
OR
You can click on the exectuable (Windows) or binary file (Linux/MacOS)
{{path_to_repo}}/dist/doc_to_renpy/doc_to_renpy
There are two levels of logging
INFO
DEBUG
INFO
is on by default.
To get DEBUG
logs, run the --verbose
flag
Examples.
python index.py --verbose
python index.py --quick_convert --verbose
Make sure you are sourced into your virtual environment
python -m unittest discover