All libraries used in this script are present in Python's standard library. For this script, make sure to have an sms.db file from which to query. With some minor modification, you can use this script with any database; however, we will specifically be talking about it with respect to the iPhone SMS database from an iOS 10.0.1 device.