chatviz.load_data.prep_sms_data¶
- chatviz.load_data.prep_sms_data(filename)¶
Processes an SMS chat file into a neat DataFrame.
Chat history can be downloaded as XML using the app SMS Backup & Restore. See here for Android.
- Parameters
- filenameUnion[int, str, bytes, PathLike]
The path to the XML chat file.
- Returns
- pd.DataFrame
A DataFrame with all of the necessary columns i.e. [‘date’, ‘name’, ‘text’].
Warning
If your chat data is from a different app then this may not work as column names will be different, but this function can be used as a basis for any file manipulations on XML data before passing the dataframe to the main function.