A simple Python tool to decrypt and extract text from Pokémon games on the Nintendo Switch.
It supports .dat and .tbl files.
Based on the pkNX project by kwsch.
Check out the original implementation in Structures/Text/TextFile.cs.
- LGPE - Let's Go Pikachu & Eevee
- SWSH - Sword & Shield
- LA - Legends Arceus
- SV - Scarlet & Violet
- LZA - Legends Z-A
python main.py <command> <input> [output] --version=<VERSION> [--format=<FORMAT>]# Extract single file to JSON
python main.py read "path/to/file.dat" "output_folder" --version=LZA --format=json
# Extract single file to TXT
python main.py read "path/to/file.dat" "output_folder" --version=LZA --format=txt
# Extract entire folder
python main.py read "path/to/dat_folder" "output_folder" --version=LZA --format=json# Compile single JSON file
python main.py write "path/to/file.json" "output_folder" --version=LZA --format=json
# Compile single TXT file
python main.py write "path/to/file.txt" "output_folder" --version=LZA --format=txt
# Compile entire folder
python main.py write "path/to/text_folder" "output_folder" --version=LZA --format=json# Merges common/, script/, sk/ folders into common.txt, script.txt, sk.txt
python main.py merge "path/to/dat_folder" --version=LZA
# Specify output folder
python main.py merge "path/to/dat_folder" "output_folder" --version=LZAOutput: One text file per subfolder with all .dat contents separated by filename.dat ~~~~
# Splits common.txt, script.txt, sk.txt back into .dat files organized by folders
python main.py split "path/to/merged_folder" "output_folder" --version=LZAFeatures:
- Validates line count against original files
- Warns if lines are missing from edited files
- json - Structured format with ID, hash, and text fields (default)
- txt - Plain text format, one line per entry
✅ Multi-threaded processing for fast batch operations
✅ Automatic subfolder detection
✅ Line count validation (merge/split)
✅ UTF-8 encoding support
✅ Progress tracking with detailed logging
✅ Error handling with comprehensive error messages
# 1. Merge all .dat files into manageable text files
python main.py merge "game/message/dat" --version=LZA
# 2. Edit the generated common.txt, script.txt, sk.txt files
# 3. Split back into .dat files
python main.py split "game/message/dat" "game/message/dat_translated" --version=LZA
# Done! Your translated .dat files are readyIf you want to help map the variables of each Pokémon game on the Switch, just open a PR for the module text_config.py.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0-only).