{"id":15285639,"url":"https://github.com/ankschoubey/whatsapptojson","last_synced_at":"2025-07-24T14:32:46.241Z","repository":{"id":62588804,"uuid":"137599942","full_name":"ankschoubey/whatsapptojson","owner":"ankschoubey","description":"Converts Whatsapp chat files to dictionary or save it in JSON format.","archived":false,"fork":false,"pushed_at":"2019-12-14T12:56:53.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T07:47:18.540Z","etag":null,"topics":["json","json-parser","whatsapp","whatsapp-chat","whatsapp-parser"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ankschoubey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-16T17:55:20.000Z","updated_at":"2022-12-10T15:55:54.000Z","dependencies_parsed_at":"2022-11-03T17:02:27.034Z","dependency_job_id":null,"html_url":"https://github.com/ankschoubey/whatsapptojson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankschoubey%2Fwhatsapptojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankschoubey%2Fwhatsapptojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankschoubey%2Fwhatsapptojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankschoubey%2Fwhatsapptojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankschoubey","download_url":"https://codeload.github.com/ankschoubey/whatsapptojson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227449892,"owners_count":17777435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json","json-parser","whatsapp","whatsapp-chat","whatsapp-parser"],"created_at":"2024-09-30T15:06:59.487Z","updated_at":"2024-11-30T23:22:52.063Z","avatar_url":"https://github.com/ankschoubey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Whatsapp-Text-To-Json-Converter\n\nConverts Whatsapp chat files to dictionary or JSON format.\n\n**Works with exports from iPhone and Android. Be sure to mention device.**\n\n## Installation\n\n```pip install whatsapptojson```\n\n## Using Command Line Arguments\n\n```python whatsapptojson.py [OPTIONS]```\n\n```\nusage: whatsapptojson.py [-h] -f FILE -d DEVICE [-s SAVE] [-v]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -f FILE, --file FILE  chat text file\n  -d DEVICE, --device DEVICE\n                        can be 'iphone' or 'android', or 'iphone_24' \n                        or 'android_24' if your file uses 24h timestamps\n  -s SAVE, --save SAVE  path of file/direction to save json, 'default' would\n                        be same as text file name in same directory\n  -v, --verbose         Verbose (Print output)\n```\n\n\n## Using Native Python\n\n```whatsapptojson.format()``` - to convert a read text to dictionary\n\n```whatsapptojson.format_file()``` - to read file from text to dictionary/json\n\nbe sure to mention ```device``` attribute correctly ```iphone```, ```android```, ```iphone_24``` or ```android_24```.\n\n```python\nfrom whatsapptojson import whatsapptojson\n\n# Converting Text to Dict\noutput = whatsapptojson.format(text = 'string with complete chat data', device = 'android')\n\n# Converting File to dictionary.\noutput = whatsapptojson.format_file(source='source_file_path', device = 'iphone')\n\n# Converting File to dictionary.\noutput = whatsapptojson.format_file(source='source_file_path', device = 'iphone')\n\n### Whatsapp File to Json.\nwhatsapptojson.format_file(source='source_file_path', destination='destination_path.json', device = 'android')\n```\n\n## Sample Export\n\n```json\n{\n  \"attachment_extensions\": [\n    \"pdf\",\n    \"mp4\",\n    \"jpg\"\n  ],\n  \"participants\": [\n    \"sender name 1\",\n    \"sender name 2\",\n    \"sender name n\"\n  ],\n  \"chats\": [\n    {\n      \"date\": \"25/03/16 07:03:45 PM\",\n      \"message\": \"‎Messages to this group are now secured with end-to-end encryption.\",\n      \"type\": \"whatsapp meta\"\n    },\n     {\n      \"date\": \"15/08/17 12:27:34 PM\",\n      \"message\": \"message for attachment\",\n      \"sender\": \"sender name\",\n      \"type\": \"attachment\",\n      \"attachment\": {\n        \"file_name\": \"file_name_with.pdf\",\n        \"meta\": \"8 pages\",\n        \"extention\": \"pdf\"\n      }\n    },  {\n      \"date\": \"15/08/17 01:37:28 PM\",\n      \"sender\": \"sender name\",\n      \"message\": \"message\",\n      \"type\": \"conversation\"\n    },\n    ...\n    ]\n}\n ```\nEach item in chats could have type of \"whatsapp meta\" or \"attachment\" or \"conversation\".\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankschoubey%2Fwhatsapptojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankschoubey%2Fwhatsapptojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankschoubey%2Fwhatsapptojson/lists"}