whatsapp-reality


Namewhatsapp-reality JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/Abdul1028/whatsapp-reality
SummaryA comprehensive WhatsApp chat analysis library
upload_time2025-01-10 21:34:37
maintainerNone
docs_urlNone
authorAbdul
requires_python>=3.7
licenseNone
keywords whatsapp chat analysis nlp sentiment emoji timeline visualization
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # WhatsApp Reality

A comprehensive Python library for analyzing WhatsApp chat exports. This library provides tools for preprocessing WhatsApp chat data and performing various analyses including sentiment analysis, user activity patterns, conversation patterns, and more.

## Installation

```bash
pip install whatsapp-reality
```

## Features

- Chat preprocessing for both Android and iOS WhatsApp exports
- Basic statistics (message counts, word counts, media counts)
- User activity analysis
- Word clouds and common words analysis
- Sentiment analysis
- Emoji analysis
- Timeline analysis (daily, monthly)
- Reply time analysis
- Conversation pattern analysis

## Quick Start

### 1. Export your WhatsApp chat

1. Open WhatsApp
2. Go to the chat you want to analyze
3. Click on the three dots (⋮) > More > Export chat
4. Choose "Without Media"
5. Save the exported text file

### 2. Analyze your chat

```python
from whatsapp_reality import preprocess, analyzer

# Read and preprocess your chat file
with open('chat.txt', 'r', encoding='utf-8') as file:
    chat_data = file.read()
    
# Create the DataFrame
df = preprocess(chat_data)

# Now you can use any of the analysis functions!

# Get basic stats
messages, words, media, links = analyzer.fetch_stats('Overall', df)
print(f"Total Messages: {messages}")
print(f"Total Words: {words}")
print(f"Media Messages: {media}")
print(f"Links Shared: {links}")

# Analyze user activity
fig, df_percent = analyzer.most_busy_users(df)
fig.show()  # Shows the interactive plotly visualization

# Generate word cloud
wordcloud = analyzer.create_wordcloud('Overall', df)

# Analyze sentiment
sentiments, most_positive, most_negative = analyzer.calculate_sentiment_percentage('Overall', df)
print(f"Most positive user: {most_positive}")
print(f"Most negative user: {most_negative}")

# Analyze reply patterns
user, time, msg, reply = analyzer.analyze_reply_patterns(df)
print(f"User with longest reply time: {user}")
print(f"Reply took {time:.2f} minutes")
```

## Supported Chat Formats

The library supports WhatsApp chat exports from both Android and iOS devices in the following formats:

### Android Format
```
DD/MM/YY, HH:mm - Username: Message
```

### iOS Format
```
[DD/MM/YY, HH:mm:ss] Username: Message
```

Both 12-hour and 24-hour time formats are supported.

## Documentation

For detailed documentation and examples, visit our [documentation page](https://github.com/Abdul1028/whatsapp-reality).

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Author

- Abdul
- [GitHub Profile](https://github.com/Abdul1028)

## Acknowledgments

Special thanks to all contributors and users of this library. 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Abdul1028/whatsapp-reality",
    "name": "whatsapp-reality",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "whatsapp chat analysis nlp sentiment emoji timeline visualization",
    "author": "Abdul",
    "author_email": "rasoolas2003@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cb/1d/8cda034d176b9b8d49baf3ff41ded1c76f491ae65bde4a57ce210a022a94/whatsapp_reality-0.1.0.tar.gz",
    "platform": null,
    "description": "# WhatsApp Reality\n\nA comprehensive Python library for analyzing WhatsApp chat exports. This library provides tools for preprocessing WhatsApp chat data and performing various analyses including sentiment analysis, user activity patterns, conversation patterns, and more.\n\n## Installation\n\n```bash\npip install whatsapp-reality\n```\n\n## Features\n\n- Chat preprocessing for both Android and iOS WhatsApp exports\n- Basic statistics (message counts, word counts, media counts)\n- User activity analysis\n- Word clouds and common words analysis\n- Sentiment analysis\n- Emoji analysis\n- Timeline analysis (daily, monthly)\n- Reply time analysis\n- Conversation pattern analysis\n\n## Quick Start\n\n### 1. Export your WhatsApp chat\n\n1. Open WhatsApp\n2. Go to the chat you want to analyze\n3. Click on the three dots (\u22ee) > More > Export chat\n4. Choose \"Without Media\"\n5. Save the exported text file\n\n### 2. Analyze your chat\n\n```python\nfrom whatsapp_reality import preprocess, analyzer\n\n# Read and preprocess your chat file\nwith open('chat.txt', 'r', encoding='utf-8') as file:\n    chat_data = file.read()\n    \n# Create the DataFrame\ndf = preprocess(chat_data)\n\n# Now you can use any of the analysis functions!\n\n# Get basic stats\nmessages, words, media, links = analyzer.fetch_stats('Overall', df)\nprint(f\"Total Messages: {messages}\")\nprint(f\"Total Words: {words}\")\nprint(f\"Media Messages: {media}\")\nprint(f\"Links Shared: {links}\")\n\n# Analyze user activity\nfig, df_percent = analyzer.most_busy_users(df)\nfig.show()  # Shows the interactive plotly visualization\n\n# Generate word cloud\nwordcloud = analyzer.create_wordcloud('Overall', df)\n\n# Analyze sentiment\nsentiments, most_positive, most_negative = analyzer.calculate_sentiment_percentage('Overall', df)\nprint(f\"Most positive user: {most_positive}\")\nprint(f\"Most negative user: {most_negative}\")\n\n# Analyze reply patterns\nuser, time, msg, reply = analyzer.analyze_reply_patterns(df)\nprint(f\"User with longest reply time: {user}\")\nprint(f\"Reply took {time:.2f} minutes\")\n```\n\n## Supported Chat Formats\n\nThe library supports WhatsApp chat exports from both Android and iOS devices in the following formats:\n\n### Android Format\n```\nDD/MM/YY, HH:mm - Username: Message\n```\n\n### iOS Format\n```\n[DD/MM/YY, HH:mm:ss] Username: Message\n```\n\nBoth 12-hour and 24-hour time formats are supported.\n\n## Documentation\n\nFor detailed documentation and examples, visit our [documentation page](https://github.com/Abdul1028/whatsapp-reality).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Author\n\n- Abdul\n- [GitHub Profile](https://github.com/Abdul1028)\n\n## Acknowledgments\n\nSpecial thanks to all contributors and users of this library. \n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A comprehensive WhatsApp chat analysis library",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Abdul1028/whatsapp-reality/issues",
        "Documentation": "https://github.com/Abdul1028/whatsapp-reality#readme",
        "Homepage": "https://github.com/Abdul1028/whatsapp-reality",
        "Source Code": "https://github.com/Abdul1028/whatsapp-reality"
    },
    "split_keywords": [
        "whatsapp",
        "chat",
        "analysis",
        "nlp",
        "sentiment",
        "emoji",
        "timeline",
        "visualization"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e5d2241996148060827947b1c50ee7806f0b3dbda6fd1c0b8d8fd64fcbef4ebb",
                "md5": "7db30f3811416a956402c2a56f696ac2",
                "sha256": "e1b10d55b986879ee6d75fea193d2fc1dd768eba4727f30a88d37110c82c4129"
            },
            "downloads": -1,
            "filename": "whatsapp_reality-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7db30f3811416a956402c2a56f696ac2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10082,
            "upload_time": "2025-01-10T21:34:34",
            "upload_time_iso_8601": "2025-01-10T21:34:34.347373Z",
            "url": "https://files.pythonhosted.org/packages/e5/d2/241996148060827947b1c50ee7806f0b3dbda6fd1c0b8d8fd64fcbef4ebb/whatsapp_reality-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb1d8cda034d176b9b8d49baf3ff41ded1c76f491ae65bde4a57ce210a022a94",
                "md5": "d258345ca5ae0be724e3da07280b1784",
                "sha256": "c456384bd946ba160dd08a52166d531e3ded7d97ec22c6aa249cbff0c7e9bdbf"
            },
            "downloads": -1,
            "filename": "whatsapp_reality-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d258345ca5ae0be724e3da07280b1784",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10692,
            "upload_time": "2025-01-10T21:34:37",
            "upload_time_iso_8601": "2025-01-10T21:34:37.215122Z",
            "url": "https://files.pythonhosted.org/packages/cb/1d/8cda034d176b9b8d49baf3ff41ded1c76f491ae65bde4a57ce210a022a94/whatsapp_reality-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 21:34:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Abdul1028",
    "github_project": "whatsapp-reality",
    "github_not_found": true,
    "lcname": "whatsapp-reality"
}
        
Elapsed time: 0.52947s