whatsapp-python
Free, open-source Python wrapper for the WhatsApp Cloud API.
Forked from Neurotech-HQ/heyoo.
Installation
To install the library you can either use pip (latest release version):
pip install whatsapp-python
You can also install the development GitHub version (always up to date, with the latest features and bug fixes):
git clone https://github.com/filipporomani/whatsapp.git
cd whatsapp
pip install .
If you want to use a local enviroment you can also use hatch:
git clone https://github.com/filipporomani/whatsapp.git
cd whatsapp
pip install hatch
hatch shell
Documentation is available in the wiki here on GitHub.
Key features:
- Modern interface using
asyncandawait - Full support for Graph API error handling
- Optimized for high-load workflows using asyncronous programming
- Always up to date
- All of the WhatsApp Business chat UI features supported
All features
- Event listening (incoming messages)
- Asyncronous API calls
- Error handling
- Sending messages
- Sending messages from different numbers individually
- Marking messages as read (optional typing indicator)
- Replying to messages
- Reacting to messages
- Sending medias (images, audios/voice notes, videos, links and documents)
- Sending location and location-request prompts
- Sending interactive buttons, lists, and CTA URL buttons
- Sending template messages
- Parsing messages and media received (including reactions)
- Sending contacts
- Uploading media to the Facebook cloud
- Automatic Graph API version discovery with a safe fallback (
v27.0)
Obtaining the WhatsApp API credentials
To use the WhatsApp API you need to create a Facebook Business account and a WhatsApp Business account.
Pricing of the API
Whereas using third-party providers of the WhatsApp API can result in monthly fees, using the WhatsApp API1 offered directly by Facebook is much cheaper, even if the billing documentation is quite difficult to understand.
All the prices are available in the WhatsApp API docs.
Migrating from Neurotech-HQ/heyoo
You can ignore this if it's your first time using the library.
- Any version >1.1.2 is incompatible with the original
heyoolibrary! Be careful updating! Read the docs first! - Any version <=1.1.2 is fully compatible with the original
heyoolibrary and doesn't include breaking changes.
Switching from heyoo to whatsapp-python doesn't require any change for versions up to 1.1.2: just uninstall heyoo, install whatsapp-python==1.1.2 and change the import name from heyoo to whatsapp.
For versions GREATER THAN 1.1.2, messages have became objects, so you need to change your code to use the new methods.
Contributing
If you are facing any issues or have any questions, please open a new issue!
This is an open source project published under the GNU Affero General Public License v3.
Metadata
Release files for whatsapp-python 4.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whatsapp_python-4.4.0.tar.gz | 47.9 kB | Without provenance | Details for whatsapp_python-4.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| whatsapp_python-4.4.0-py3-none-any.whl | Python 3 | none | any | Details for whatsapp_python-4.4.0-py3-none-any.whl |
Total release size: 91.5 kB
Release files / whatsapp_python-4.4.0.tar.gz
| Download URL | whatsapp_python-4.4.0.tar.gz |
|---|---|
| Size | 47.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31b1e94c7589d229830b21944ab6ed412f4971f6d9db76828f409aa45a073b83
|
|
BLAKE2b-256 checksum How to use checksums |
291d7653c49ec83c970902dd2eaf6e716ed014c7a8b5563f62d1bb2447883303
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / whatsapp_python-4.4.0-py3-none-any.whl
| Download URL | whatsapp_python-4.4.0-py3-none-any.whl |
|---|---|
| Size | 43.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c1f41416bf5ca052c490cadccfaf5b8edac4bb46b60952d24cc6d2e79d8e4d1b
|
|
BLAKE2b-256 checksum How to use checksums |
a59246d38e6cedf2a7c99ec0ef006ae81bd4959fb2d635c2503f64695c0a9da1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for whatsapp-python 4.4.0
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.