Export SMS, phone history and contacts to Android device?

It’s 1.5 years after someone last asked on this thread, but just in case it’s still of interest, I wrote a script to import text messages & call history from an Android phone: