Whatstk Versions Save

WhatsApp chats as dataframes. Python toolkit to analyse and parse WhatsApp chats.

v0.6.3

8 months ago

v0.6.2

9 months ago

Minor fixes to the documentation.

v0.6.1

9 months ago

Bump plotly version to ~5.0.0

v0.6.0

1 year ago
  • Support for python=3.10 and python=3.11.
  • Minor documentation corrections

v0.5.0

2 years ago

Contents

Enhancements #

Windows support #

Details in #119

CI/CD for Windows created. Passing all tests.

Previously reported errors (#102) due to encoding problems.

GDrive support #

Details in #117, #116

Motivated by #113

Load a chat from Google Drive

You can also load a file saved in your Google Drive. Note that in order to do so, you need first to configure the credentials to interact with Google Drive.

Configure credentials

In particular, you need the client secret JSON file. This can be downloaded from the Google Console. To get this file, we recommend following this tutorial, which is inspired by PyDrive2 documentation. Some important additions to previous tutorials are:

  • Make sure to add yourself in Test users, as noted in this thread
  • Select Desktop App instead of Web Application as the application type when creating the OAuth Client ID.

Once you have downloaded the client secrets, run gdrive_init, which will guide you through the Authentification process. You will need to access a link via your browser and copy paste a verification code.

from whatstk.utils import gdrive_init
gdrive_init("path/to/client_secrets.json")

This should only be run the first time to correctly configure your Google credentials.

Load a file from Google Drive

You can pass a file reference to WhatsAppChat by means of its ID. All files in Google Drive have a unique ID. To obtain it, create a shareable link, which will have the following format:

https://drive.google.com/file/d/[FILE-ID]/view?usp=sharing

Now, simply copy [FILE-ID] and run:

from whatstk import WhatsAppChat
chat = WhatsAppChat.from_source("gdrive://[FILE-ID]")

Note that Google Drive file IDs are passed with the prefix gdrive://.

Pandas friendly #

Details in #122

Method df_from_txt_whatsapp is now available from root, e.g.:

from whatstk import df_from_txt_whatsapp
df = df_from_txt_whatsapp("path/to/chat.txt")

The motivation is to make it more pandas-friendly.

Dependencies #

Details in #121

Generate and GDrive functionalities now deemed as extensions. To install dependencies for these run pip install whatstk[gdrive] and pip install whatstk[generate], respectively.

Deprecated #

cummulative #

Details in #120

Legacy argument cummulative deprecated from methods get_interventions_count, and user_interventions_count_linechart

Bug fixes #

Remove print statement #

There was a print statement in the library.

Properly add static files to the library #

That means:

  • Add __init__.py module to library folders containing static files.
  • Add static files to MANIFEST.in

v0.5.0.rc1

2 years ago

See updates in #123

v0.5.0.rc0

2 years ago

v0.4.1

3 years ago

When exporting a WhatsAppChat to CSV, exclude the index column.

v0.4.0

3 years ago

Key updates

Support for Python 3.9 (support for Python 3.6 discontinued)

Library dependencies and tests have been updated so as to make whatstk compatible with Python 3.9. This however lead to the discontinuation of Python 3.6 support.

New chat df format

Date field was being used as the index of the chat DataFrame. This does not make sense, as dates may be repeated and we'd ideally have unique identifiers for each row entry. Now, the ids are numeric integers ordered by message date.

Now (>=v0.4.0)

>>> from whatstk import WhatsAppChat
>>> from whatstk.data import whatsapp_urls
>>> chat = WhatsAppChat.from_source(filepath=whatsapp_urls.POKEMON)
>>> chat.df.head(5)
                 date     username                                            message
0 2016-08-06 13:23:00  Ash Ketchum                                          Hey guys!
1 2016-08-06 13:25:00        Brock              Hey Ash, good to have a common group!
2 2016-08-06 13:30:00        Misty  Hey guys! Long time haven't heard anything fro...
3 2016-08-06 13:45:00  Ash Ketchum  Indeed. I think having a whatsapp group nowada...
4 2016-08-06 14:30:00        Misty                                          Definetly

Deprecated (<=v0.3.1)

>>> from whatstk import WhatsAppChat
>>> from whatstk.data import whatsapp_urls
>>> chat = WhatsAppChat.from_source(filepath=whatsapp_urls.POKEMON)
>>> chat.df.head(5)
                        username                                            message
date                                                                               
2016-08-06 13:23:00  Ash Ketchum                                          Hey guys!
2016-08-06 13:25:00        Brock              Hey Ash, good to have a common group!
2016-08-06 13:30:00        Misty  Hey guys! Long time haven't heard anything fro...
2016-08-06 13:45:00  Ash Ketchum  Indeed. I think having a whatsapp group nowada...
2016-08-06 14:30:00        Misty                                          Definetly

v0.3.1

3 years ago