WhatsApp LinkCraft
WhatsApp LinkCraft is a Python package designed to generate structured and validated WhatsApp chat links from user-provided phone numbers. It leverages language models to ensure correct formatting and automatically handle common input variations and errors, providing a clickable WhatsApp URL ready for use.
Installation
Install the package via pip:
pip install whatsapp_linkcraft
Usage
Here's a basic example of how to use the package:
from whatsapp_linkcraft import whatsapp_linkcraft
# Example user input
user_input = "+1 234 567 8901"
# Generate WhatsApp link (uses default LLM)
links = whatsapp_linkcraft(user_input)
print(links)
You can also pass your own LLM instance if desired. The default uses ChatLLM7 from langchain_llm7, which is compatible with various LLM providers.
Custom LLM Usage
The package enables you to specify your preferred language model. For example:
Using OpenAI's GPT
from langchain_openai import ChatOpenAI
from whatsapp_linkcraft import whatsapp_linkcraft
llm = ChatOpenAI()
response = whatsapp_linkcraft(user_input, llm=llm)
Using Anthropic
from langchain_anthropic import ChatAnthropic
from whatsapp_linkcraft import whatsapp_linkcraft
llm = ChatAnthropic()
response = whatsapp_linkcraft(user_input, llm=llm)
Using Google Generative AI
from langchain_google_genai import ChatGoogleGenerativeAI
from whatsapp_linkcraft import whatsapp_linkcraft
llm = ChatGoogleGenerativeAI()
response = whatsapp_linkcraft(user_input, llm=llm)
Parameters
- user_input (
str): The text input from the user containing the phone number to process. - llm (
Optional[BaseChatModel]): An instance of a language model. Defaults toChatLLM7. - api_key (
Optional[str]): API key for LLM7. If not provided, the package attempts to fetch from environment variableLLM7_API_KEY. To use a custom key, pass it directly or set the environment variable.
Notes
- Relies on
ChatLLM7fromlangchain_llm7by default. You may replace it with other language model instances from LangChain. - Default rate limits of LLM7 free tier are generally sufficient; for higher limits, provide your own API key.
License
This project is maintained by Eugene Evstafev.
Email: hi@eugene.plus
GitHub: chigwell
Issues
For issues or suggestions, visit: GitHub Issues
Metadata
Release files for whatsapp-linkcraft 2025.12.21183621
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| whatsapp_linkcraft-2025.12.21183621.tar.gz | 4.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| whatsapp_linkcraft-2025.12.21183621-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / whatsapp_linkcraft-2025.12.21183621.tar.gz
| Download URL | whatsapp_linkcraft-2025.12.21183621.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fb48f6275b1dda26e42c0ff5f1fb5ed16264892dc9e3c3e92cca0838a6c0696c
|
|
BLAKE2b-256 checksum How to use checksums |
14bedbc4ca108ebe1a0970c8c4ac66df81c0ad2bee0c5aacd70f0a9c4287f307
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / whatsapp_linkcraft-2025.12.21183621-py3-none-any.whl
| Download URL | whatsapp_linkcraft-2025.12.21183621-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80355afb947bc3395a5bdc1ec388bd8e0677c3272f0d8fd37d38adb0f046c398
|
|
BLAKE2b-256 checksum How to use checksums |
c579c34a5e26c3d66437843f1674d817e78994d117f45bc03281be9c956a710d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|