[GH-ISSUE #129] whachat / dateformat #115

Closed
opened 2026-02-25 20:34:41 +03:00 by kerem · 6 comments
Owner

Originally created by @datenhain on GitHub (Jul 26, 2021).
Original GitHub issue: https://github.com/B16f00t/whapa/issues/129

HI,

the whachat commandline help has the option [-f [FORMAT]] that implies every date format can be parsed
instead of choosing the pre-defined formats android/ios if mobileOS is selected with -s.

I have a text export with date format "24.07.21, 10:15"

But i don't get it working with the commandline, and option -r EN -f "%d.%m.%y, %H:%M" chatfile.txt

After changing the dates in chatfile.txt to pre-defined android format "%d/%m/%y %H:%M" it works with
the gui but still not with commandline whachat.py

thx

Originally created by @datenhain on GitHub (Jul 26, 2021). Original GitHub issue: https://github.com/B16f00t/whapa/issues/129 HI, the whachat commandline help has the option [-f [FORMAT]] that implies every date format can be parsed instead of choosing the pre-defined formats android/ios if mobileOS is selected with -s. I have a text export with date format "24.07.21, 10:15" But i don't get it working with the commandline, and option -r EN -f "%d\.%m\.%y, %H:%M" chatfile.txt After changing the dates in chatfile.txt to pre-defined android format "%d/%m/%y %H:%M" it works with the gui but still not with commandline whachat.py thx
kerem closed this issue 2026-02-25 20:34:41 +03:00
Author
Owner

@B16f00t commented on GitHub (Jul 29, 2021):

Ok, let me check it

<!-- gh-comment-id:889331416 --> @B16f00t commented on GitHub (Jul 29, 2021): Ok, let me check it
Author
Owner

@B16f00t commented on GitHub (Aug 2, 2021):

Can you tell me the complete format of one line?
Ex. Android
23/5/18 15:24 - USER: TEXT TEXT TEXT

The problem is that depending on the operating system and language the log form changes.

Give a try the latest version 1.55 and see if it solves the problem.

<!-- gh-comment-id:891144914 --> @B16f00t commented on GitHub (Aug 2, 2021): Can you tell me the complete format of one line? Ex. Android 23/5/18 15:24 - USER: TEXT TEXT TEXT The problem is that depending on the operating system and language the log form changes. Give a try the latest version 1.55 and see if it solves the problem.
Author
Owner

@datenhain commented on GitHub (Aug 4, 2021):

Hi,

the good note is: the german dateformat [12.01.21, 23:42:00] is now recognized and parsed wth the GUI :-)
But..., with commandline I was only able to genereate the participant list, I could not find
the right way to generate the report only with the commandline.

I tried:

python .\libs\whachat.py "D:\path_to_chat_chat.txt" -p -f -s ios -r EN
python .\libs\whachat.py "D:\path_to_chat_chat.txt" -p -f -s ios -r EN -u "username"
python .\libs\whachat.py "D:\path_to_chat_chat.txt" -p -f -s ios -r EN -u "username" -f "%d.%m.%y %H:%M:%S"
python .\libs\whachat.py "D:\path_to_chat_chat.txt" -p -f -s ios -r EN -u "username" -f "%d.%m.%y, %H:%M:%S"

if i omit the "-s ios", no participant list is generated.

So, since the GUI is parsing the dots now with v1.55, this is only a cosmetic problem.

thx
Chris

<!-- gh-comment-id:892596431 --> @datenhain commented on GitHub (Aug 4, 2021): Hi, the good note is: the german dateformat [12.01.21, 23:42:00] is now recognized and parsed wth the GUI :-) But..., with commandline I was only able to genereate the participant list, I could not find the right way to generate the report only with the commandline. I tried: python .\libs\whachat.py "D:\path_to_chat\_chat.txt" -p -f -s ios -r EN python .\libs\whachat.py "D:\path_to_chat\_chat.txt" -p -f -s ios -r EN -u "username" python .\libs\whachat.py "D:\path_to_chat\_chat.txt" -p -f -s ios -r EN -u "username" -f "%d.%m.%y %H:%M:%S" python .\libs\whachat.py "D:\path_to_chat\_chat.txt" -p -f -s ios -r EN -u "username" -f "%d.%m.%y, %H:%M:%S" if i omit the "-s ios", no participant list is generated. So, since the GUI is parsing the dots now with v1.55, this is only a cosmetic problem. thx Chris
Author
Owner

@B16f00t commented on GitHub (Aug 5, 2021):

python "FULLPATH\libs\whachat.py "D:\path_to_chat_chat.txt"-s android -f "%d.%m.%y %H:%M:%S" -r EN -u "username"

Try this even though you can see the command line in the status bar.

<!-- gh-comment-id:893380436 --> @B16f00t commented on GitHub (Aug 5, 2021): python "FULLPATH\libs\whachat.py "D:\path_to_chat_chat.txt"-s android -f "%d.%m.%y %H:%M:%S" -r EN -u "username" Try this even though you can see the command line in the status bar.
Author
Owner

@datenhain commented on GitHub (Aug 5, 2021):

i tried:

python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s android -f "%d.%m.%y %H:%M:%S" -p
python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s android -f "%d.%m.%y, %H:%M:%S" -p

does nothing

python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s ios -f "%d.%m.%y, %H:%M:%S" -p
working

python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s ios -f "%d.%m.%y %H:%M:%S" -r EN -u "username"
working

python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s android -f "%d.%m.%y %H:%M:%S" -r EN -u "username"

generates an exception:

Traceback (most recent call last):
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\range.py", line 385, in get_loc
    return self._range.index(new_key)
ValueError: 1 is not in range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\XXX\Desktop\whapa-master\libs\whachat.py", line 660, in <module>
    if dataframe.loc[i]['Author']:
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 931, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1164, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1113, in _get_label
    return self.obj.xs(label, axis=axis)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 3773, in xs
    loc = index.get_loc(key)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\range.py", line 387, in get_loc
    raise KeyError(key) from err
KeyError: 1
<!-- gh-comment-id:893433245 --> @datenhain commented on GitHub (Aug 5, 2021): i tried: ``` python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s android -f "%d.%m.%y %H:%M:%S" -p python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s android -f "%d.%m.%y, %H:%M:%S" -p ``` does nothing `python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s ios -f "%d.%m.%y, %H:%M:%S" -p` working `python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s ios -f "%d.%m.%y %H:%M:%S" -r EN -u "username"` working `python.exe .\libs\whachat.py 'D:\path_to_chat_de.txt' -s android -f "%d.%m.%y %H:%M:%S" -r EN -u "username"` generates an exception: ``` Traceback (most recent call last): File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\range.py", line 385, in get_loc return self._range.index(new_key) ValueError: 1 is not in range The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\XXX\Desktop\whapa-master\libs\whachat.py", line 660, in <module> if dataframe.loc[i]['Author']: File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 931, in __getitem__ return self._getitem_axis(maybe_callable, axis=axis) File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1164, in _getitem_axis return self._get_label(key, axis=axis) File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexing.py", line 1113, in _get_label return self.obj.xs(label, axis=axis) File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\generic.py", line 3773, in xs loc = index.get_loc(key) File "C:\Users\XXX\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\range.py", line 387, in get_loc raise KeyError(key) from err KeyError: 1 ```
Author
Owner

@B16f00t commented on GitHub (Aug 23, 2021):

If the gui works, the terminal must work, copy the complete command, with full paths

<!-- gh-comment-id:903537263 --> @B16f00t commented on GitHub (Aug 23, 2021): If the gui works, the terminal must work, copy the complete command, with full paths
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whapa#115
No description provided.