A lightweight Python package for cleaning text data.
Project description
cleantextify 🧹✨
A lightweight, customizable Python package for cleaning text data.
Removes URLs, HTML tags, emojis, numbers, punctuation, and normalizes whitespace — perfect for text preprocessing in NLP, data cleaning, and web scraping projects.
📦 Installation
Install from PyPI:
pip install cleantextify
✨ Features
- 🚀 Remove URLs
- 🧼 Remove HTML tags
- 😂 Remove emojis
- 🔢 Remove numbers
- 📏 Normalize whitespace
- ! Remove punctuations
📖 Usage
Basic Example:
from cleantextify import clean_text
text = "Hello world! 🌟 Visit https://example.com <br> 123"
cleaned = clean_text(text)
print(cleaned)
# Output: Hello world Visit
Output:
Hello world Visit
🔧 Customizable Options
| Parameter | Type | Default | Description |
|---|---|---|---|
remove_urls |
bool |
True |
Remove URLs from text. |
remove_html |
bool |
True |
Remove HTML tags and entities. |
remove_emojis |
bool |
True |
Remove emojis. |
remove_numbers |
bool |
True |
Remove numbers. |
remove_punct |
bool |
True |
Remove punctuation marks. |
normalize_spaces |
bool |
True |
Replace multiple spaces with a single space. |
📚 Full Usage Examples:
Remove only URLs and Emojis:
from cleantextify import clean_text
text = "Check this out! 😃 https://example.com"
cleaned = clean_text(text, remove_urls=True, remove_emojis=True, remove_numbers=False, remove_punct=False, normalize_spaces=True)
print(cleaned)
Output:
Check this out
Remove All but Keep Numbers:
from cleantextify import clean_text
text = "Score: 99! 🎉 Visit: https://test.com"
cleaned = clean_text(text, remove_numbers=False)
print(cleaned)
Output:
Score 99 Visit
Only Normalize Spaces:
from cleantextify import clean_text
text = "This is a test."
cleaned = clean_text(text, remove_urls=False, remove_html=False, remove_emojis=False, remove_numbers=False, remove_punct=False, normalize_spaces=True)
print(cleaned)
Output:
This is a test.
📜 License
MIT License
📞 Author
Rajdeep Pandhere
rajdeeppandhere36coc@gmail.com
📦 PyPI Link
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 cleantextify-0.1.6.tar.gz.
File metadata
- Download URL: cleantextify-0.1.6.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ebc0f5b98b7b580fed87c03ac64681d86eb559f3e0a64470b2684ddf72b38a1
|
|
| MD5 |
57277484251f3950291e97178f64142c
|
|
| BLAKE2b-256 |
f38ebe2e7cdba7d106e122d2acb8758300b45145b90736811175a6dcaa8b1123
|
File details
Details for the file cleantextify-0.1.6-py3-none-any.whl.
File metadata
- Download URL: cleantextify-0.1.6-py3-none-any.whl
- Upload date:
- Size: 2.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86d259d083982aa593ae885f489c18f236417e21e66e4b48f4526227f52514bc
|
|
| MD5 |
a104826217e1e1128fdca56492e7db1c
|
|
| BLAKE2b-256 |
a47176885b2f9df5b9426f599be955b60b32c77da2ac92c706176c4c34162603
|