explaingit

tgalal/yowsup

7,170PythonAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

A Python library for building applications that send and receive messages over WhatsApp. It handles the WhatsApp protocol and encryption so you can write custom bots or notification senders without reverse-engineering the protocol yourself.

Mindmap

mindmap
  root((yowsup))
    What it does
      WhatsApp protocol
      End-to-end encryption
      Send and receive messages
    Companion libraries
      python-axolotl
      consonance
      dissononce
    Tools
      yowsup-cli
      Terminal interface
    Platforms
      Linux
      Mac
      Windows
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a custom WhatsApp bot that receives incoming messages and replies automatically based on your own logic.

USE CASE 2

Create a command-line WhatsApp client for scripting or automation on Linux, Mac, or Windows.

USE CASE 3

Send WhatsApp notifications from your own application when a server alert or scheduled event fires.

Tech stack

PythonSignal ProtocolNoise Protocol

Getting it running

Difficulty · hard Time to first run · 1h+

Linux needs Python dev headers and ncurses-dev, Windows needs the mingw compiler, last updated December 2021 so WhatsApp protocol compatibility may have drifted.

GPLv3 or later, free to use and modify, but if you distribute software that includes it you must also release your source code under GPLv3.

In plain English

yowsup is a Python library for building applications that can communicate with WhatsApp users. The project started as the internal protocol engine for unofficial WhatsApp clients on the Meego and BlackBerry 10 mobile platforms, and has since been separated into a standalone library that developers can use to power their own custom WhatsApp-compatible tools. The library handles the low-level details of the WhatsApp protocol, including the cryptographic handshake and end-to-end encryption. To keep the codebase maintainable, several protocol components were spun out into separate Python packages: python-axolotl handles the Signal encryption protocol used by WhatsApp, consonance implements WhatsApp's connection handshake using the Noise Protocol, and dissononce is a general-purpose Noise Protocol implementation. These companion libraries are installed automatically as dependencies. A command-line tool called yowsup-cli comes alongside the library and provides a way to interact with WhatsApp from a terminal. Optional features like image sending and media handling require additional packages such as Pillow and requests. Installation is via pip on Linux, Mac, and Windows. Linux users need Python development headers and ncurses-dev before running the setup script. Windows requires the mingw compiler and a small configuration change. The library supports Python 2.7 through 3.7. The README is brief and refers readers to the project wiki for architecture documentation, a sample application walkthrough, and a guide to using the command-line tool. The last recorded update in the README is December 2021. The library is licensed under GPLv3+.

Copy-paste prompts

Prompt 1
I want to build a WhatsApp bot using yowsup that replies to incoming messages automatically. Walk me through installing the library and writing a minimal bot that echoes messages back.
Prompt 2
How do I use yowsup-cli to test sending a WhatsApp message from the command line before building a full application?
Prompt 3
I'm installing yowsup on Linux and getting errors about missing headers. What system packages do I need to install first?
Prompt 4
I want to use yowsup to send a WhatsApp message when my server monitoring script detects a problem. Show me the Python code to send a single message.
Prompt 5
What does python-axolotl do in yowsup and why is Signal Protocol encryption required to connect to WhatsApp?
Open on GitHub → Explain another repo

← tgalal on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.