Giter Club home page Giter Club logo

Comments (5)

JoshEe00 avatar JoshEe00 commented on June 3, 2024

I'm still facing this error. Is there an update on how to fix it?

from whatstk.

lucasrodes avatar lucasrodes commented on June 3, 2024

hi @JoshEe00,
I'll try to address this bug these days. Can you share a slice of your chat so it helps me debug (feel free to replace the message content for whatever)?

from whatstk.

lucasrodes avatar lucasrodes commented on June 3, 2024

Could you, @JoshEe00 or @pumalife, share a demo text exported from your chat as a TXT file? Could you replace its messages if needed? Also, please share the code you tried to read and the error that you got. Otherwise it is hard for me to debug this bug.

I copied the chat content from @pumalife into a txt file, and then running

from whatstk import df_from_txt_whatsapp
df = df_from_txt_whatsapp("chat-139.txt", hformat="[%m/%d/%y, %H:%M:%S] %name:")

And it seems to work fine. Could you please confirm again that this is not working for you (and what error are you having)?

Incidentally, if I open the TXT file with the chat, I can read some characters I am not familiar with.

image

from whatstk.

JoshEe00 avatar JoshEe00 commented on June 3, 2024

WhatsappTestChat.txt

Here's the text I used. I had to manually configure to hformat to get it to work.

For my case, the chat was exported on Android.

from whatstk.

lucasrodes avatar lucasrodes commented on June 3, 2024

Hi @JoshEe00,
The automatic header is not working for you because of line 3, where you have the following:

04/03/2024, 22:29 - +1-374-8523 added you to a group in the community: Community 1

This is wrongly interpreted as a user message and breaks the processing. Current workarounds would be to:

  1. Define the format manually:
df = df_from_whatsapp("WhatsappTestChat.txt", hformat="%d/%m/%y, %H:%M - %name:")
  1. Remove line 3 from the TXT file.

This file might be exported from a community (not a group), showing different exported chat structures.

I will close this issue for now and have written up an issue that follows up on this: #147. Once this issue is fixed, the library should work out of the box for you.

Thanks for reporting!

from whatstk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.