Metadata-Version: 2.4
Name: py-whatsapp-formatter
Version: 1.0.0
Summary: Convert Markdown and HTML to WhatsApp-compatible formatting
Author-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/yourusername/whatsapp-formatter
Project-URL: Repository, https://github.com/yourusername/whatsapp-formatter
Project-URL: Issues, https://github.com/yourusername/whatsapp-formatter/issues
Keywords: whatsapp,markdown,html,formatter,converter
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Markup
Classifier: Topic :: Communications :: Chat
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# WhatsApp Formatter

A Python library to convert Markdown and HTML to WhatsApp-compatible formatting.

## Installation

```bash
pip install whatsapp-formatter
```

## Usage

```python
from whatsapp_formatter import convert_markdown_to_whatsapp, convert_html_to_whatsapp

# Convert Markdown to WhatsApp format
text = convert_markdown_to_whatsapp("**Bold** and *italic* and ~~strikethrough~~")
# Output: "*Bold* and _italic_ and ~strikethrough~"

# Convert HTML to WhatsApp format
text = convert_html_to_whatsapp("<strong>Bold</strong> <em>italic</em>")
# Output: "*Bold* _italic_"
```

## WhatsApp Formatting Reference

| Format | WhatsApp Syntax | Markdown | HTML |
|--------|-----------------|----------|------|
| Bold | `*text*` | `**text**` | `<b>`, `<strong>` |
| Italic | `_text_` | `*text*` | `<i>`, `<em>` |
| Strikethrough | `~text~` | `~~text~~` | `<s>`, `<strike>`, `<del>` |
| Monospace | `` `text` `` | `` `text` `` | `<code>` |
| Code block | ` ```text``` ` | ` ```text``` ` | - |

## Advanced Usage

For more control, use the converter classes directly:

```python
from whatsapp_formatter import MarkdownToWhatsAppConverter, HTMLToWhatsAppConverter

# Custom Markdown converter
converter = MarkdownToWhatsAppConverter()
converter.add_post_processor(lambda x: x.strip())
result = converter.convert("  **Hello**  ")

# HTML converter without tag stripping
converter = HTMLToWhatsAppConverter(strip_remaining_tags=False)
result = converter.convert("<b>Bold</b> <span>kept</span>")
```

## Requirements

- Python 3.9+
- No external dependencies

## License

MIT License

