Skip to main content

A lightweight Python package for cleaning text data.

Project description

cleantextify 🧹✨

PyPI version Downloads

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

https://pypi.org/project/cleantextify/

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

cleantextify-0.1.6.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

cleantextify-0.1.6-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

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

Hashes for cleantextify-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5ebc0f5b98b7b580fed87c03ac64681d86eb559f3e0a64470b2684ddf72b38a1
MD5 57277484251f3950291e97178f64142c
BLAKE2b-256 f38ebe2e7cdba7d106e122d2acb8758300b45145b90736811175a6dcaa8b1123

See more details on using hashes here.

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

Hashes for cleantextify-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 86d259d083982aa593ae885f489c18f236417e21e66e4b48f4526227f52514bc
MD5 a104826217e1e1128fdca56492e7db1c
BLAKE2b-256 a47176885b2f9df5b9426f599be955b60b32c77da2ac92c706176c4c34162603

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