Whatstk

Latest version: v0.7.1

Safety actively analyzes 688568 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.6.0

- Support for `python=3.10` and `python=3.11`.
- Minor documentation corrections

0.5.0

Contents
- [Enhancements](enh)
- [Windows support](windows)
- [GDrive support](gdrive-support)
- [Pandas friendly](pandas)
- [Dependencies](dependencies)
- [Deprecated](deprecated)
- [Argument cumulative](cummulative)
- [Bug fixes](bug-fixes)
- [Remove print statement](print)
- [Properly add static files to the library](static)

Enhancements <a href="enh" id="enh"></a>

Windows support <a href="windows" id="windows"></a>
_Details in 119_

CI/CD for Windows created. Passing all tests.

Previously reported errors (102) due to encoding problems.

GDrive support <a href="gdrive-support" id="gdrive-support"></a>
_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](https://medium.com/analytics-vidhya/how-to-connect-google-drive-to-python-using-pydrive-9681b2a14f20), which is
inspired by [PyDrive2 documentation](https://iterative.github.io/PyDrive2/docs/build/html/quickstart.html). Some
important additions to previous tutorials are:

- Make sure to add yourself in Test users, as noted in [this thread](https://stackoverflow.com/questions/65980758/pydrive-quickstart-and-error-403-access-denied)
- 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.

python
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](https://support.google.com/drive/answer/7166529?co=GENIE.Platform%3DDesktop&hl=en), which will have the following format:


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


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



python
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 <a href="pandas" id="pandas"></a>
_Details in 122_

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

python
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 <a href="dependencies" id="dependencies"></a>
_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 <a href="deprecated" id="deprecated"></a>
`cummulative` <a href="cummulative" id="cummulative"></a>
_Details in 120_

Legacy argument `cummulative` deprecated from methods `get_interventions_count`, and `user_interventions_count_linechart`

Bug fixes <a href="bug-fixes" id="bug-fixes"></a>

Remove print statement <a href="print" id="print"></a>
There was a print statement in the library.

Properly add static files to the library <a href="static" id="static"></a>
That means:
- Add `__init__.py` module to library folders containing static files.
- Add static files to MANIFEST.in

0.5.0.rc1

See updates in 123

0.5.0.rc0

0.4.1

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

0.4.0

python
>>> 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

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.