Transforms phone numbers into direct WhatsApp chat links for easy conversations.
Project description
whatsapp-linkify
whatsapp-linkify is a Python package that transforms phone numbers into direct WhatsApp chat links. It allows users to input a phone number or text containing phone numbers, and processes this input to generate structured WhatsApp chat URLs. This is especially useful for businesses, customer support teams, or anyone needing quick access to WhatsApp chats without manually formatting links.
Installation
Install the package via pip:
pip install whatsapp_linkify
Usage
Here's a basic example of how to use the package:
from whatsapp_linkify import whatsapp_linkify
results = whatsapp_linkify(
user_input="Call me at +1234567890 or +19876543210.",
)
print(results)
Parameters
-
user_input:
str
The input text containing phone numbers to process. -
llm:
Optional[BaseChatModel]
An optional language model instance to use. If not provided, the defaultChatLLM7fromlangchain_llm7is used. -
api_key:
Optional[str]
An optional API key for LLM7. If not provided, it will be fetched from the environment variableLLM7_API_KEY.
LLM Compatibility and Customization
The package uses ChatLLM7 from the langchain_llm7 package (https://pypi.org/project/langchain-llm7/).
Developers can pass their own language model instances to whatsapp_linkify, supporting models such as:
-
OpenAI (via
langchain_openai.ChatOpenAI)from langchain_openai import ChatOpenAI from whatsapp_linkify import whatsapp_linkify llm = ChatOpenAI() response = whatsapp_linkify(user_input, llm=llm)
-
Anthropic (via
langchain_anthropic.ChatAnthropic)from langchain_anthropic import ChatAnthropic from whatsapp_linkify import whatsapp_linkify llm = ChatAnthropic() response = whatsapp_linkify(user_input, llm=llm)
-
Google Generative AI (via
langchain_google_genai.ChatGoogleGenerativeAI)from langchain_google_genai import ChatGoogleGenerativeAI from whatsapp_linkify import whatsapp_linkify llm = ChatGoogleGenerativeAI() response = whatsapp_linkify(user_input, llm=llm)
The default rate limits for LLM7’s free tier are sufficient for most use cases. For higher limits, users can obtain an API key from https://token.llm7.io/ and pass it via the api_key parameter or environment variable.
License
This project is maintained by Eugene Evstafev.
Author email: hi@euegne.plus
GitHub profile: chigwell
Issues
For issues and feature requests, please visit:
https://github.com/chigwell/whatsapp-linkify/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whatsapp_linkify-2025.12.21184318.tar.gz.
File metadata
- Download URL: whatsapp_linkify-2025.12.21184318.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4d3c398af748dadcc8b77cba2430c543bee93ea0a6ee09cd686cfea7ab5cbda
|
|
| MD5 |
0c50e1959f59a64b9df4abe598531427
|
|
| BLAKE2b-256 |
dd7682a398e87a650624890bf4ca03a0bcc60cfe40acd54243efbcc262c0fd17
|
File details
Details for the file whatsapp_linkify-2025.12.21184318-py3-none-any.whl.
File metadata
- Download URL: whatsapp_linkify-2025.12.21184318-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f67febb6ebe83c1814b7ca9bfe7cff1100fcc2ac0e0f6600e1d08dd963db16de
|
|
| MD5 |
e2bc3733f0be59312176a3645ad06dac
|
|
| BLAKE2b-256 |
4813818ba055ed795a52b6cedafe287173c7a6a6fc9fb8e4a32769e531e65d9a
|