sandsturm / whatsapp-converter

Use this application to convert your exported WhatsApp chat to a CSV, Excel or ODS file.
MIT License
17 stars 8 forks source link

issue with datetime #9

Closed gryshkoff closed 3 years ago

gryshkoff commented 3 years ago

chat,txt contains data on english and ukrainian language

C:\Python\Lib\site-packages\whatsapp_converter>python whatsapp_converter.py chat.txt chat.csv Converting data now 0%| | 0/1584 [00:00<?, ?it/s] 0%|▏ | 4/1584 [00:00<?, ?it/s] Traceback (most recent call last): File "C:\Python\Lib\site-packages\whatsapp_converter\whatsapp_converter.py", line 226, in convert(filename=args.filename, resultset=args.resultset, verbose=args.verbose, debug=args.debug) File "C:\Python\Lib\site-packages\whatsapp_converter\whatsapp_converter.py", line 191, in convert csv.write(dataset[1] + ' ' + dataset[2] + '|' + dataset[1] + '|' + dataset[2] + '|' + dataset[3] + '|' + dataset[4] + '\n') TypeError: unsupported operand type(s) for +: 'datetime.date' and 'str'

sandsturm commented 3 years ago

Can you please attach an anonymized export of the chat? I once had an export of a Russian chat and it converted the chat without problems.

gryshkoff commented 3 years ago

Thanks for your reply, if possible, please describe step by step, I'm not quite a confident python user

Thank you!

Downloaded and deleted the message

sandsturm commented 3 years ago

Hmmm. It works perfectly on my computer, I got a clean export. Did you use pip to install the whatsapp-converter package?

What you could try (if chat.txt is inside the whatsapp_converter directory):

cd ..
python -m whatsapp_converter whatsapp_converter/chat.txt chat.csv
gryshkoff commented 3 years ago

Yes, I did. i used next link

https://pypi.org/project/whatsapp-converter/#description

ср, 23 июн. 2021 г. в 13:17, Martin Sand @.***>:

Hmmm. It works perfectly on my computer. Did you use pip to install the whatsapp-converter package?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sandsturm/whatsapp-converter/issues/9#issuecomment-866714216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSZGMOXN4PI566RI22VCMTTUGYD3ANCNFSM47FKSJCA .

sandsturm commented 3 years ago

Can you please check the python version? It works only with python3:

python --version

gryshkoff commented 3 years ago

Just used your command Convert WhatsApp TXT to CSV (Default Use Case) No CSV file was created , and were it must be generated, same path?

C:\Python\Lib\site-packages\whatsapp_converter>whatsapp_converter.py chat.txt Converting data now 100%|█████████████████████████████████████████████████████████████████████████| 20843/20843 [00:00<00:00, 115221.18it/s] Wrote 20665 lines

Also your command has name python whatsapp-converter.py and filename is whatsapp_converter.py

ср, 23 июн. 2021 г. в 13:20, Dmitriy Hryshkov @.***>:

Yes, I did. i used next link

https://pypi.org/project/whatsapp-converter/#description

ср, 23 июн. 2021 г. в 13:17, Martin Sand @.***>:

Hmmm. It works perfectly on my computer. Did you use pip to install the whatsapp-converter package?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sandsturm/whatsapp-converter/issues/9#issuecomment-866714216, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSZGMOXN4PI566RI22VCMTTUGYD3ANCNFSM47FKSJCA .

sandsturm commented 3 years ago

So it worked? The default file is saved in the same directory as the whatsapp-converter. It is called result.csv.

gryshkoff commented 3 years ago

No, it didn't. [image: image.png] No CSV created

ср, 23 июн. 2021 г. в 13:42, Martin Sand @.***>:

So it worked? The default file is saved in the same directory as the whatsapp-converter. It is called result.csv.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sandsturm/whatsapp-converter/issues/9#issuecomment-866730358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSZGMJ34CJVPIRHGD5GXJTTUG3DBANCNFSM47FKSJCA .

sandsturm commented 3 years ago

Also your command has name python whatsapp-converter.py and filename is whatsapp_converter.py

If you installed whatsapp-converter via pip, than you could just start it from the command line without the .py extension. See here:

(env) [tmp]$ whatsapp-converter example-cyrillic result.csv
Reading import file
Converting data now
100%|████████████████████████████████████████████████████████████████████████████| 2813/2813 [00:00<00:00, 64412.56it/s]
Writing to result.csv
Wrote 2746 lines
gryshkoff commented 3 years ago

[image: image.png] [image: image.png]

no CSV IS CREATED where must stay export.txt?

ср, 23 июн. 2021 г. в 13:52, Martin Sand @.***>:

Also your command has name python whatsapp-converter.py and filename is whatsapp_converter.py

If you installed whatsapp-converter via pip, than you could just start it from the command line without the .py extension. See here:

(env) [tmp]$ whatsapp-converter example-cyrillic result.csv

Reading import file

Converting data now

100%|████████████████████████████████████████████████████████████████████████████| 2813/2813 [00:00<00:00, 64412.56it/s]

Writing to result.csv

Wrote 2746 lines

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sandsturm/whatsapp-converter/issues/9#issuecomment-866735868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSZGMM5OZOMGGNJ6K6XGS3TUG4IBANCNFSM47FKSJCA .

sandsturm commented 3 years ago

Sorry, the pictures are not attached. I think you need to upload and attach them here in the chat.

where must stay export.txt?

It does not matter. Typically in the same directory where you execute the whatsapp-converter command. Alternatively you can provide an absolute path, e.g. /tmp/export.txt on a Linux system.

gryshkoff commented 3 years ago

photo_2021-06-23_15-23-13 NO "writing result.csv"

sandsturm commented 3 years ago

For sure you are using an old version of the converter because the -n argument is not shown. Can you please upgrade the application via pip? Maybe this helps.

pip install --upgrade whatsapp_converter

gryshkoff commented 3 years ago

update log.txt

sandsturm commented 3 years ago

Can you please check that you have python3 installed?

python --version

gryshkoff commented 3 years ago

of course , i have latest python 3.9.5 Almost solved , i mannualy downloaded files and replaced , now i have - n argument (pip install --upgrade whatsapp_converter did not help ) Now situation like this, i cant find resultset.csv image

gryshkoff commented 3 years ago

Solved ,the result is saved to the desktop in the whatsapp-converter-0.5.4 folder that I accidentally added there. Thank you for support!

sandsturm commented 3 years ago

Perfect, happy to hear that!