whatstk.utils

Library generic utils.


whatstk.utils.chat_merge

Merging chats.

Functions

merge_chats(dfs) Merge several chats into a single one.
whatstk.utils.chat_merge.merge_chats(dfs)[source]

Merge several chats into a single one.

Can come in handy when you have old exports and new ones, and both have relevant data.

Note: The dataframes must have an index with the timestamps of the messages, as this is required to correctly sort and merge the chats.

Parameters:dfs (List[pandas.DataFrame]) – List with the chats as DataFrames.
Returns:pandas.DataFrame – Merged chat.

whatstk.utils.exceptions

Library exceptions.

Exceptions

HFormatError Raised when hformat could not be found.
RegexError Raised when regex match is not possible.
exception whatstk.utils.exceptions.HFormatError[source]

Bases: Exception

Raised when hformat could not be found.

exception whatstk.utils.exceptions.RegexError[source]

Bases: Exception

Raised when regex match is not possible.


whatstk.utils.utils

Utils.

Classes

ColnamesDf Access class constants using variable whatstk.utils.utils.COLNAMES_DF.
class whatstk.utils.utils.ColnamesDf[source]

Bases: object

Access class constants using variable whatstk.utils.utils.COLNAMES_DF.

Example

Attributes

DATE Date column
MESSAGE Message column
MESSAGE_LENGTH Message length column
USERNAME Username column

Access constant COLNAMES_DF.DATE:

>>> from whatstk.utils.utils import COLNAMES_DF
>>> COLNAMES_DF.DATE
'date'
DATE = 'date'

Date column

MESSAGE = 'message'

Message column

MESSAGE_LENGTH = 'message_length'

Message length column

USERNAME = 'username'

Username column