Skip to main content

Transforms phone numbers into direct WhatsApp chat links for easy conversations.

Project description

whatsapp-linkify

PyPI version License: MIT Downloads LinkedIn

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 default ChatLLM7 from langchain_llm7 is used.

  • api_key: Optional[str]
    An optional API key for LLM7. If not provided, it will be fetched from the environment variable LLM7_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whatsapp_linkify-2025.12.21184318.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whatsapp_linkify-2025.12.21184318-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file whatsapp_linkify-2025.12.21184318.tar.gz.

File metadata

File hashes

Hashes for whatsapp_linkify-2025.12.21184318.tar.gz
Algorithm Hash digest
SHA256 b4d3c398af748dadcc8b77cba2430c543bee93ea0a6ee09cd686cfea7ab5cbda
MD5 0c50e1959f59a64b9df4abe598531427
BLAKE2b-256 dd7682a398e87a650624890bf4ca03a0bcc60cfe40acd54243efbcc262c0fd17

See more details on using hashes here.

File details

Details for the file whatsapp_linkify-2025.12.21184318-py3-none-any.whl.

File metadata

File hashes

Hashes for whatsapp_linkify-2025.12.21184318-py3-none-any.whl
Algorithm Hash digest
SHA256 f67febb6ebe83c1814b7ca9bfe7cff1100fcc2ac0e0f6600e1d08dd963db16de
MD5 e2bc3733f0be59312176a3645ad06dac
BLAKE2b-256 4813818ba055ed795a52b6cedafe287173c7a6a6fc9fb8e4a32769e531e65d9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page