Skip to main content

tgnize

accumulatedChatTrafficByMinuteOfDevsChatGroupTelegram

How about another exported Telegram Chat analyzer ? ๐Ÿ˜‰

nomenclature

Telegram + ( Chat ) Analyze = tgnize

motivation

  • I'm always interested in learning more about data, which is why I thought about taking a deeper look into Telegram Chats ( mostly groups ), I participate in.
  • I exported chat data ( excluding audios, videos and images etc. ), of Devs Chat group, using Telegram Desktop Client, which are nothing but some HTML, CSS & JS files
  • I created an object model, into which I populated parsed Chat data, so that I can manipulate it well
  • Then I started plotting animated charts & much more ( a lot of work remaining though ), to depict how participants contributed to chat
  • It also lets me understand my chat activity pattern(s) i.e. in which hour of the day I'm mostly active / inactive in Chat
  • Or how another peer is spending their time is Chat
  • What's mostly used words / mostly used bots / mostly used Emoji etc. in Chat

caution

This project doesn't expect you to use any exported Chat for manipulating any participant or use extracted data ( sleep patterns, daily activity pattern of participants ) for doing some harmful activity to any participant.

If users use it for malicious purpose(s), it's not author's responsibility !!!

I suggest you not to use it for manipulating someone else. Thank you for understanding ๐Ÿ˜‰

data source

Here I'm using Devs Chat's, exported Chat data set for testing these scripts. So all plots ( to be ๐Ÿ˜‰ ) generated, present in this repository, are result of application of scripts on Devs Chat's exported Chat data.

Template data set is present here. It holds all messages of Devs Chat upto 03/11/2019 from initialization of group.

For respecting privacy of all users, I'm removing that data source from this public repo. Export chat data for your own need.

exporting chat

For exporting chat data for Devs Chat group of Telegram, I used Official Telegram Desktop Client. Exporting was done, while only including text messages ( no images, videos or audios ), which are nothing but a bunch of HTML files.

If you want to run these scripts on your machine, make sure you've Telegram Desktop Client installed.

$ sudo snap install telegram-desktop # run on your linux terminal

Log into your account and choose which chat to export. Well this expoting procedure can take some time, depending upon age & activeness of Chat.

usage

  • Download this zip from here
  • Unzip it into a suitable directory on your machine
  • Get into tgnize directory
$ cd tgnize
$ tree -h
.
โ”œโ”€โ”€ [4.2K]  app.py
โ”œโ”€โ”€ [4.0K]  docs
โ”‚   โ””โ”€โ”€ [1.8K]  minuteBasedAccumulatedTraffic.md
โ”œโ”€โ”€ [ 227]  install
โ”œโ”€โ”€ [1.0K]  LICENSE
โ”œโ”€โ”€ [4.0K]  model
โ”‚   โ”œโ”€โ”€ [ 245]  activity.py
โ”‚   โ”œโ”€โ”€ [9.8K]  chat.py
โ”‚   โ”œโ”€โ”€ [ 332]  event.py
โ”‚   โ”œโ”€โ”€ [ 100]  __init__.py
โ”‚   โ”œโ”€โ”€ [1.3K]  message.py
โ”‚   โ”œโ”€โ”€ [ 515]  plotDataRange.py
โ”‚   โ””โ”€โ”€ [1.1K]  user.py
โ”œโ”€โ”€ [4.0K]  plotting_scripts
โ”‚   โ”œโ”€โ”€ [ 100]  __init__.py
โ”‚   โ”œโ”€โ”€ [ 169]  messageCount.py
โ”‚   โ””โ”€โ”€ [ 11K]  minuteBasedAccumulatedTraffic.py
โ”œโ”€โ”€ [2.7K]  README.md
โ”œโ”€โ”€ [  56]  requirements.txt
โ”œโ”€โ”€ [  47]  tgnize
โ””โ”€โ”€ [4.4K]  util.py

3 directories, 18 files
  • Make sure you've python3-pip installed, which will be required for installing python modules ( i.e. beautifulsoup4, matplotlib etc. )
  • Run install script ( BASH script ), which will download all required dependencies into your machine
$ ./install
  • For generating animated plots, you'll need to have imagemagick installed on your machine. Install it using your system package manager.
$ sudo apt-get install imagemagick # for debian based distros
$ sudo dnf install imagemagick # for fedora
  • Now you need to add installation path of tgnize, into your PATH variable
$ pwd # copy it
  • If you're on BASH, find .bashrc under your home directory, if not found create a file with that name
  • Add follwing line at end of that file, while replacing paste-here section with installation path of tgnize
export PATH="$PATH:paste-here"
  • Now close this terminal window & open a new one
  • You'll have tgnize, executable BASH script present under downloaded zip, on your path. Simply invoke tgnize directly, to be sure things are working as they're supposed to be
$ cd # get to home directory
$ tgnize
[+]tgnize v0.1.0 - How about another Telegram Chat Analyzer ?

	$ tgnize `path-to-exported-chat-dir` `path-to-sink-dir`

[+]Author: Anjan Roy<anjanroy@yandex.com>
[+]Source: https://github.com/itzmeanjan/tgnize ( MIT Licensed )

[!]Error : Improper Invocation of `tgnize`
  • It's asking you to properly invoke script, by giving source directory ( holding exported telegram chat, of a single Chat, may be a lot of files in case of large Chats ) & sink directory ( will hold generated plots / charts )
  • If you've already exported some Telegram chat, consider invoking this script, to understand how you spent your time in Chat

progress

This project is in its infancy, a lot of features to be added. If you've something in your mind, don't hesitate to create an issue or make a PR

Got some new idea ? Make a PR ๐Ÿ˜‰

Work in Progress - coming with more details soon

Metadata

Release files for tgnize 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tgnize 0.1.3
File Size Uploaded Provenance
tgnize-0.1.3.tar.gz 16.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tgnize 0.1.3
File Interpreter ABI Platform
tgnize-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 62.6 kB

Release files / tgnize-0.1.3.tar.gz

Download URL tgnize-0.1.3.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c01a55932a839d2739140c2791abc74f4a83341420c1297daa59b374541ad8f8
BLAKE2b-256 checksum
How to use checksums
5140b3c42da8940b922d6b323e9a67e546da06e53e0dd7402903b22c78a0aee0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.21.0

Release files / tgnize-0.1.3-py3-none-any.whl

Download URL tgnize-0.1.3-py3-none-any.whl
Size 46.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f2deb62e347ede5ae988f569e0c89a8fda8cbe38779779b150b9688a93a97b0
BLAKE2b-256 checksum
How to use checksums
f525aa2d16fd6cc2657227149d96c0d2219219bbdbc50af07e44ebead1e91556
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.21.0

Security for tgnize 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page