Instagram provides you the ability to download all your account data localy, but most of your data are stored as JSON files and that makes it less user friendly.
This script uses the messages.json file, to extract all your text chats / conversations, and stores them in separate .txt files depending on the username of the person you communicated with.
You just need to run the script in the same folder you have stored the messages.json file, and various .txt files will be auto-created.
The .txt files have this format: