Skip to content

Commit 3bd30d7

Browse files
authored
Merge pull request #123 from lucasrodes/release/0.5.0
Release/0.5.0
2 parents 74abeea + 184b8e5 commit 3bd30d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+633
-172
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.4.1
2+
current_version = 0.5.0.rc0
33
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(.(?P<pre>[a-z]+)(?P<prenum>\d+))?
44
serialize =
55
{major}.{minor}.{patch}.{pre}{prenum}

.coveragerc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[run]
22
branch = True
3-
omit = whatstk/tests/*
3+
omit =
4+
whatstk/tests/*
5+
whatstk/scripts/*
46

57
[report]
68
fail_under=80

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,8 @@ reports
282282

283283
docs/_build/
284284
package-lock.json
285-
version-changes
285+
version-changes
286+
287+
client_secrets.json
288+
settings.yaml
289+
credentials.json

.travis.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,45 @@ python:
77
git:
88
depth: false
99
before_install:
10+
- pip install --upgrade pip
11+
install:
1012
# - git fetch --tags
13+
#
1114
- pip install -r requirements-test.txt
1215
- pip install -r requirements-flake.txt
13-
install:
1416
- ls -l
1517
- pip uninstall whatstk
16-
- pip install -e .
18+
- pip install .[full]
19+
# - ls -l /home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/whatstk/whatsapp/assets/
20+
- cat MANIFEST.in
1721
- mkdir -p tests/chats/hformats tests/chats/merge
1822
- whatstk-generate-chat --size 500 --output-path tests/chats/hformats/ # Generate chats for hformat checks
1923
- whatstk-generate-chat --size 300 --last-timestamp 2019-09-01 --hformats '%Y-%m-%d, %H:%M - %name:' --output-path tests/chats/merge/ --filenames file1.txt
2024
- whatstk-generate-chat --size 300 --last-timestamp 2020-01-01 --hformats '%Y-%m-%d, %H:%M - %name:' --output-path tests/chats/merge/ --filenames file2.txt
2125
#pip install -r requirements.txt
2226
script:
2327
- flake8 --max-complexity=10 --docstring-convention=google --max-line-length=120 whatstk
24-
- pytest --cov-report term --cov=whatstk tests/
28+
- pytest --cov-report term --cov=whatstk tests
2529
after_success:
2630
- codecov # submit coverage
2731

2832
jobs:
2933
include:
34+
# perform a linux build
35+
# - services: docker
36+
# and a windows build
37+
- os: windows
38+
language: shell
39+
before_install:
40+
- choco upgrade python -y --version 3.8.6
41+
- export PATH="/c/Python38:/c/Python38/Scripts:$PATH"
42+
# make sure it's on PATH as 'python3'
43+
- ln -s /c/Python38/python.exe /c/Python38/python3.exe
3044
- stage: deploy
3145
python: 3.8
46+
before_deploy:
47+
- python3 -m pip install cibuildwheel==1.11.0
48+
- python3 -m cibuildwheel --output-dir wheelhouse
3249
deploy:
3350
- provider: pypi
3451
user: $USER_PYPI

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ include *.md
22
include LICENSE
33
include requirements.txt
44
include requirements-test.txt
5+
include requirements-flake.txt
6+
include requirements-docs.txt
7+
include whatstk/whatsapp/assets/header_format_support.json
58
include .coveragerc
69

710
recursive-include altair *.py *.json *.ipynb *.html

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
</h1>
66
<p align="left">
77
<a href="#">
8-
<img alt="Package version" src="https://img.shields.io/badge/pypi-0.4.1-blue.svg?&color=25D366&logo=whatsapp&">
8+
<img alt="Package version" src="https://img.shields.io/badge/pypi-0.5.0.rc0-blue.svg?&color=25D366&logo=whatsapp&">
99
</a>
1010
</p>
1111
<!-- style=for-the-badge -->
1212

1313
<p align="left">
14-
<a href="https://travis-ci.org/lucasrodes/whatstk">
14+
<a href="https://travis-ci.com/lucasrodes/whatstk">
1515
<img alt="Build Status" src="https://travis-ci.com/lucasrodes/whatstk.svg?branch=develop">
1616
</a>
1717
<a href="https://codecov.io/gh/lucasrodes/whatstk">
@@ -20,15 +20,15 @@
2020
<a href='https://whatstk.readthedocs.io/en/stable/?badge=stable'>
2121
<img src='https://readthedocs.org/projects/whatstk/badge/?version=stable' alt='Documentation Status' />
2222
</a>
23+
<a href="https://towardsdatascience.com/analyzing-whatsapp-chats-with-python-20d62ce7fe2d">
24+
<img alt="Tutorial" src="https://img.shields.io/badge/tutorial-on_medium-1a8917.svg?&logo=medium&logoColor=white">
25+
</a>
2326
<a href="https://www.python.org/downloads/release/python-3/">
2427
<img alt="Python 3" src="https://img.shields.io/badge/python-3.7|3.8|3.9-blue.svg?&logo=python&logoColor=yellow">
2528
</a>
2629
<a href="https://pepy.tech/badge/whatstk">
2730
<img alt="Number of downloads" src="https://pepy.tech/badge/whatstk">
2831
</a>
29-
<a href="http://github.com/lucasrodes/whatstk">
30-
<img alt="HitCount" src="https://views.whatilearened.today/views/github/lucasrodes/whatstk.svg">
31-
</a>
3232
<a href="https://github.com/lucasrodes/whatstk/blob/master/LICENSE">
3333
<img alt="GitHub license" src="https://img.shields.io/github/license/lucasrodes/whatstk.svg?">
3434
</a>
@@ -64,29 +64,32 @@ It is distributed under the GPL-3.0 license.
6464
pip install whatstk
6565
```
6666

67+
Install develop version (not stable):
68+
69+
```
70+
pip install git+https://github.com/lucasrodes/whatstk.git@develop
71+
```
72+
6773
_More details [here](https://whatstk.readthedocs.io/en/stable/source/about.html#installation-compatibility)_
6874

6975
## Getting Started
76+
For a rapid introduction, check this [tutorial on Medium](https://towardsdatascience.com/analyzing-whatsapp-chats-with-python-20d62ce7fe2d).
7077

7178
#### Export your chat using your phone:
7279
_See [instructions](https://whatstk.readthedocs.io/en/stable/source/getting_started/export_chat.html)._
7380

74-
#### Convert chat to csv
75-
Easily convert your txt chat file to csv using command `whatstk-to-csv`.
81+
#### Load chat as a DataFrame
7682

77-
```bash
78-
$ whatstk-to-csv [input_filename] [output_filename]
83+
```python
84+
from whatstk import df_from_txt_whatsapp
85+
df = df_from_txt_whatsapp("path/to/chat.txt")
7986
```
8087

81-
#### Load chat in python
82-
You can also load the exported txt file with python.
88+
#### Convert chat to csv
8389

84-
```python
85-
from whatstk import WhatsAppChat
86-
from whatstk.data import whatsapp_urls
87-
chat = WhatsAppChat.from_source(filepath=whatsapp_urls.LOREM)
90+
```bash
91+
$ whatstk-to-csv [input_filename] [output_filename]
8892
```
89-
9093
#### More examples
9194

9295
_See more in sections [getting started](https://whatstk.readthedocs.io/en/stable/source/getting_started/index.html) and

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@
1919
from sphinx.ext.autosummary import get_documenter
2020
from docutils.parsers.rst import directives
2121
from sphinx.util.inspect import safe_getattr
22+
from datetime import datetime
2223

2324

2425
# -- Project information -----------------------------------------------------
2526

2627
project = 'whatstk'
27-
copyright = '2020, sociepy'
28-
copy_right = '2020, sociepy'
28+
copyright = f'{datetime.now().year}, sociepy'
29+
copy_right = f'{datetime.now().year}, sociepy'
2930
author = 'lucasrodes'
3031

3132
# The full version, including alpha/beta/rc tags
32-
version = 'v0.4.1'
33+
version = 'v0.5.0.rc0'
3334

3435

3536
# -- General configuration ---------------------------------------------------

docs/source/about.rst

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,35 +46,55 @@ This project is on `PyPI <https://pypi.org/project/whatstk/>`_, install it with
4646
4747
pip install whatstk
4848
49-
Project has been tested with Python 3.7-3.8.
49+
Project has been tested in Python>=3.7.
5050

5151
From source
5252
^^^^^^^^^^^
53-
Clone the project from the `official repository <https://github.com/lucasrodes/whatstk/>`_
53+
Clone the project from the `official repository <https://github.com/lucasrodes/whatstk/>`_ and install it locally
5454

5555
.. code-block:: bash
5656
5757
git clone https://github.com/lucasrodes/whatstk.git
58+
cd whatstk
59+
pip install .
5860
61+
Extensions
62+
^^^^^^^
63+
To use Google Drive or Chat Generation support, install the library along with the corresponding extensions:
64+
65+
.. code-block:: bash
5966
60-
and install it locally
67+
pip install whatstk[gdrive]
6168
6269
.. code-block:: bash
6370
64-
cd whatstk
65-
pip install .
71+
pip install whatstk[generate]
72+
73+
Or install the full suite:
74+
75+
.. code-block:: bash
76+
77+
pip install whatstk[full]
6678
6779
6880
Develop
6981
^^^^^^^
7082
You can also install the version in development directly from github
71-
`develop <https://github.com/lucasrodes/whatstk/tree/develop>`_ branch.
83+
`develop <https://github.com/lucasrodes/whatstk/tree/develop>`_ branch.
84+
85+
.. code-block:: bash
86+
87+
pip install git+https://github.com/lucasrodes/whatstk.git@developDevelop
88+
^^^^^^^
89+
You can also install the version in development directly from github
90+
`develop <https://github.com/lucasrodes/whatstk/tree/develop>`_ branch.
7291

7392
.. code-block:: bash
7493
75-
pip install
7694
pip install git+https://github.com/lucasrodes/whatstk.git@develop
7795
96+
Note: It requires `git <https://git-scm.com/>`_ to be installed.
97+
7898
----
7999

80100
Support

docs/source/api/cmd/cmd_chat_gen.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
``whatstk-generate-chat``
22
=========================
33

4+
.. warning::
5+
6+
To use the chat generation functionalities, install the library with the corresponding extension (ignore the
7+
``--upgrade`` option if you haven't installed the library):
8+
9+
.. code-block::
10+
11+
pip install whatstk[generate] --upgrade
12+
413
Generate random WhatsApp chat.
514

615
.. code-block:: bash
716
817
whatstk-generate-chat --help
9-
usage: Generate chat. [-h] -o OUTPUT_PATH
18+
usage: Generate chat. Make sure to install the library with required extension: pip install whatstk[generate]
19+
--upgrade
20+
[-h] -o OUTPUT_PATH
1021
[--filenames FILENAMES [FILENAMES ...]] [-s SIZE]
1122
[-f HFORMATS [HFORMATS ...]]
1223
[--last-timestamp LAST_TIMESTAMP] [-v]

docs/source/api/whatstk.utils.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ whatstk.utils.chat\_merge
1919

2020
----
2121

22+
whatstk.utils.gdrive
23+
------------------------
24+
25+
.. automodule:: whatstk.utils.gdrive
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
30+
----
31+
2232
whatstk.utils.exceptions
2333
------------------------
2434

@@ -36,3 +46,5 @@ whatstk.utils.utils
3646
:members:
3747
:undoc-members:
3848
:show-inheritance:
49+
50+

docs/source/code_examples/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ Basic examples
77
.. toctree::
88
:maxdepth: 1
99

10-
Load chat <load_chat>
11-
Load chat from multiple sources <load_chat_multiple>
12-
Load chat with specific hformat <load_chat_hformat>
10+
Load WhatsApp chat <load_chat>
11+
Load WhatsApp chat from multiple sources <load_chat_multiple>
12+
Load WhatsApp chat from Google Drive <load_chat_gdrive>
13+
Load WhatsApp chat with specific hformat <load_chat_hformat>
1314
Rename usernames <load_chat_multiple>
1415

1516
Visualisations

docs/source/code_examples/load_chat.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Load chat
2-
==============
1+
Load WhatsApp chat
2+
==================
33

44
Once you have :doc:`exported <../getting_started/export_chat>` a chat it is time to load it in python.
55

@@ -14,8 +14,8 @@ develop/chats/whatsapp/lorem.txt>`_, which is available online, using library cl
1414
>>> chat = WhatsAppChat.from_source(filepath=whatsapp_urls.LOREM)
1515
1616
Once loaded, we can check some of the chat messages by accessing its attribute :func:`df <whatstk.WhatsAppChat.df>`,
17-
which is a pandas.DataFrame with columns `username` (name of user sending the message), `message` (message sent) and
18-
`date` index (timestamp of message).
17+
which is a pandas.DataFrame with columns `date` index (timestamp of message), `username` (name of user sending the
18+
message) and `message` (message sent).
1919

2020
.. code-block:: python
2121
@@ -40,4 +40,12 @@ Also, getting a list with the chat members is simple
4040
.. code-block:: python
4141
4242
>>> chat.users
43-
['+1 123 456 789', 'Giuseppe', 'John', 'Mary']
43+
['+1 123 456 789', 'Giuseppe', 'John', 'Mary']
44+
45+
----
46+
47+
.. seealso::
48+
49+
* :ref:`Load WhatsApp chat from multiple sources <Load WhatsApp chat from multiple sources>`
50+
* :ref:`Load WhatsApp chat from Google Drive <Load WhatsApp chat from Google Drive>`
51+
* :ref:`Load WhatsApp chat with specific hformat <Load WhatsApp chat with specific hformat>`

0 commit comments

Comments
 (0)