Skip to content

Commit

Permalink
Merge pull request #39 from lucasrodes/release/v0.2.5
Browse files Browse the repository at this point in the history
Release/v0.2.5
  • Loading branch information
lucasrodes committed May 1, 2020
2 parents c59b7e4 + edbcde8 commit c0870fb
Show file tree
Hide file tree
Showing 21 changed files with 319 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.4
current_version = 0.2.5

[bumpversion:file:setup.py]

Expand Down
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
branch = True
omit = whatstk/tests/*

[report]
fail_under=80
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,8 @@ examples

#tox stuff
tox.ini
.coveragerc
#.coveragerc
requirements-flake.txt
requirements-test.txt
setup.cfg
testreport.html
testreport.xml
Expand All @@ -269,4 +268,5 @@ py37
*.ipynb

.pypirc
learn/
learn/
assets/style.css
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
dist: xenial
language: python
python:
- 3.7.2
- 3.8
- 3.7.2
- 3.8
before_install:
- pip install -r requirements-test.txt
install:
- pip install .
- ls -l
- pip uninstall whatstk
- pip install -e .
#pip install -r requirements.txt
script:
- pytest
- pip freeze | grep whatstk
- pytest --cov-report term --cov=whatstk tests/
after_success:
- codecov # submit coverage
deploy:
provider: pypi
user: $USER_PYPI
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
include *.md
include LICENSE
include requirements.txt
include requirements-test.txt
include .coveragerc

recursive-include altair *.py *.json *.ipynb *.html
global-exclude *.py[co] __pycache__
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# [whatstk](http://lucasrodes.github.io/whatstk)

![Package version](https://img.shields.io/badge/whatstk-v0.2.4-teal.svg?style=for-the-badge&color=25D366&logo=whatsapp)
![Package version](https://img.shields.io/badge/whatstk-v0.2.5-teal.svg?style=for-the-badge&color=25D366&logo=whatsapp)

[![Build Status](https://travis-ci.com/lucasrodes/whatstk.svg?branch=develop)](https://travis-ci.com/lucasrodes/whatstk)
[![codecov](https://codecov.io/gh/lucasrodes/whatstk/branch/master/graph/badge.svg)](https://codecov.io/gh/lucasrodes/whatstk)
[![Python 3.6](https://img.shields.io/badge/python-3.7|3.8-blue.svg)](https://www.python.org/downloads/release/python-3/)
[![Documentation](https://img.shields.io/badge/documentation-royalblue.svg)](docs/index.md)
[![GitHub license](https://img.shields.io/github/license/lucasrodes/whatstk.svg)](https://github.com/lucasrodes/whatstk/blob/master/LICENSE)
[![GitHub
license](https://img.shields.io/github/license/lucasrodes/whatstk.svg)](https://github.com/lucasrodes/whatstk/blob/master/LICENSE)


<!-- [![Downloads](https://pepy.tech/badge/whatstk)](https://pepy.tech/project/whatstk) -->
> [Get the Desktop App](https://lcsrg.me/whatstk-gui)
whatstk is a Python module for WhatsApp chat group analysis and distributed under the GPL-3.0 license.
Expand All @@ -28,7 +32,7 @@ Make sure to first obtain the chat to be analyzed. Export it as a `txt` file usi

Check more on how-to use it in the [docs](docs/index.md)

#### Obtain a dataframe from your chat log file
### Obtain a dataframe from your chat log file

Load your chat using the object `WhatsAppChat`. Example below we use chat [example.txt](chats/example.txt)

Expand Down Expand Up @@ -68,7 +72,7 @@ header format. In our example, it would be: `hformat = '%d.%m.%y, %H:%M - %name:
_Note 2: If your chat uses 12h clock, it may not work as expected. If it is your case, please report it in the issues section._


#### Plot the cumulative messages sent by day
### Plot the cumulative messages sent by day
Once you have your `WhatsAppChat` object, you can easily get the number of interventions per user per, say, `day` using
the method `interventions()` with `date_mode` argument set to `'day'`. With this, some minor processing, `plotly` and `vis` method from `whatstk.plot` you can get really insightful plots.

Expand All @@ -86,7 +90,7 @@ plot(vis(counts_cumsum, 'cumulative number of messages sent per day'))

![](assets/example1.png)

### What's the header?
## What's the header?
The chat file syntax can differ between devices, OS and language settings, which makes it hard some times to correctly parse the data and make WhatsTK work correctly.

The header appears for each message sent in the chat. It contains a timestamp and the name of the user that sent the message.
Expand Down Expand Up @@ -149,6 +153,22 @@ header unit.
</tr>
</table>

## Known issues
- 12h clock header format is not supported.

## Contribute

We are very open to have collaborators. You can freely fork and issue a pull request with your updates!
For other issues/bugs/suggestions, please report it as an issue or [text me](mailto:[email protected]).
For other issues/bugs/suggestions, please report it as an issue or [text me](mailto:[email protected]).

### Pull Requests

Make sure to test your code before issuing a pull request:

```
py.test --cov-report term --cov=whatstk tests/
```

_Note 1: Use `--html=testreport.html --cov-report html` to generate HTML reports._

However, pull requests will trigger the Travis CI pipeline, which will run the tests as well.
13 changes: 2 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* [parse\_chat](#.whatstk.utils.parser.parse_chat)
* [remove\_alerts\_from\_df](#.whatstk.utils.parser.remove_alerts_from_df)
* [whatstk.utils.exceptions](#.whatstk.utils.exceptions)
* [InterventionModeError](#.whatstk.utils.exceptions.InterventionModeError)
* [whatstk.objects](#.whatstk.objects)
* [WhatsAppChat](#.whatstk.objects.WhatsAppChat)
* [\_\_init\_\_](#.whatstk.objects.WhatsAppChat.__init__)
Expand Down Expand Up @@ -120,7 +119,7 @@ The unit of time can be chosen by means of argument `date_mode`.

**Raises**:

- `whatstk.exceptions.InterventionModeError` - if invalid mode is chosen.
- `ValueError` - if invalid mode is chosen.

<a name=".whatstk.core"></a>
## whatstk.core
Expand Down Expand Up @@ -254,15 +253,6 @@ Tries to get rid of alert/notification messages

Library exceptions.

<a name=".whatstk.utils.exceptions.InterventionModeError"></a>
### InterventionModeError

```python
class InterventionModeError(Exception)
```

Raised when a non-implemented mode is selected.

<a name=".whatstk.objects"></a>
## whatstk.objects

Expand Down Expand Up @@ -338,6 +328,7 @@ Get length of DataFrame
#### shape

```python
| @property
| def WhatsAppChat.shape()
```

Expand Down
6 changes: 4 additions & 2 deletions make-docs.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Make sure to have pydoc-markdown:develop installed
# Make sure to have pydoc-markdown (develop branch) installed
# pip install git+https://github.com/NiklasRosenstein/pydoc-markdown.git@develop
#
# Then simply execute `sh make-docs.sh`

# Script to make documentation
mkdir -p docs
mkdir -p docs/modules

rm -fr docs/*
pydoc-markdown pydoc-markdown.yaml -m whatstk >> docs/index.md
pydoc-markdown pydoc-markdown.yml -m whatstk >> docs/index.md

# mkdir -p docs/modules
# rm -fr docs/modules/*
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pytest>=5.4.1
pytest-cov>=2.8.1
coverage>=4.5.1
codecov>=2.0.22
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name='whatstk',
version="0.2.4",
version="0.2.5",
description="Parser and analytics tools for WhatsApp group chats",
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -28,8 +28,16 @@
zip_safe=False,
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
keywords='whatsapp analysis parser chat',
project_urls={
'Documentation': 'https://lcsrg.me/whatstk/docs/index.html',
'Github': 'http://github.com/lucasrodes/whatstk'
},
python_requires='>=3.5'
)
File renamed without changes.
21 changes: 21 additions & 0 deletions tests/chats/example_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[2016/04/15 15:04] You created group “Sample Group”
[2016/08/06 13:18] Messages you send to this group are now secured with end-to-end encryption. Tap for more info.
[2016/08/06 13:23] Ash Ketchum: Hey guys!
[2016/08/06 13:25] Brock: Hey Ash, good to have a common group!
[2016/08/06 13:30] Misty: Hey guys! Long time haven't heard anything from you
[2016/08/06 13:45] Ash Ketchum: Indeed. I think having a whatsapp group nowadays is a good idea
[2016/08/06 14:30] Misty: Definetly
[2016/08/06 17:25] Brock: I totally agree
[2016/08/07 11:45] Prof. Oak: Kids, shall I design a smart poke-ball?
[2016/08/07 18:45] Ash Ketchum: I don't mind Prof. I quitted capturing pokemon.
[2016/08/07 19:30] Misty: Was a great time, but had enough also.
[2016/08/07 23:25] Brock: Guys, I am still in the first gym. No one is playing pokemon, they went crazy with pokemon Go.
[2016/08/10 09:45] Jessie & James: Hey, thanks for adding us. Wanna meet soon? Just for the old times.
[2016/08/10 11:25] Raichu: I am in!
[2016/08/10 13:23] Ash Ketchum: FFS, no way, Pikachu did you evolve?
[2016/08/10 15:23] Raichu: Yes... Weird to have a different body!
[2016/08/11 19:30] Misty: Gotta see that.
[2016/09/11 20:25] Meowth: Hey people, I was on holidays in Sinnoh. Crazy region.
[2016/10/31 11:45] Prof. Oak: Smart-pokeball is created.
[2016/10/31 12:23] Wobbuffet: Wo-bbu-ffet

Loading

0 comments on commit c0870fb

Please sign in to comment.