A Python utility package for string manipulation (slugify, truncate, palindrome, etc.)
Project description
texttoolkitx
texttoolkitx is a lightweight, developer-friendly Python package offering utility functions to streamline string manipulation and text formatting. It's perfect for developers, data engineers, and students who frequently work with raw or unstructured text.
✨ Features
- 🔤 Convert to
snake_case,camelCase, andPascalCase - 🔄 Reverse any string
- 🧹 Normalize and clean messy text (e.g. extra spaces, special characters)
- 🔢 Count characters, words, and lines
- 🔎 Check for palindromes or repeated characters
- ✂️ Truncate long strings with custom suffixes
📦 Installation
Install from the official PyPI index:
pip install texttoolkitx
🚀 Usage
Here are a few simple examples to get started:
1. Import the functions
from texttoolkitx import (
clean_text,
is_valid_email,
to_snake_case,
reverse_string,
count_words,
truncate_text
)
2. Clean messy text
text = " Hello!! This is messy??? "
cleaned = clean_text(text)
print(cleaned) # Output: "Hello This is messy"
3. Convert string to snake_case
print(to_snake_case("HelloWorldExample")) # Output: hello_world_example
4. Reverse a string
print(reverse_string("Python")) # Output: nohtyP
5. Count words in a sentence
sentence = "This is a test."
print(count_words(sentence)) # Output: 4
6. Truncate text
long_text = "This sentence is too long to display completely."
print(truncate_text(long_text, max_length=20)) # Output: "This sentence is..."
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check issues and submit a pull request.
🌐 Project Links
🔗 PyPI: texttoolkitx
💻 GitHub: https://github.com/Mahdirizvi114/texttoolkitx
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 texttoolkitx-0.1.2.tar.gz.
File metadata
- Download URL: texttoolkitx-0.1.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab9f75243bc39402f03120ef9b7e6f94074935c362d8847a56ddcd90606ae9f0
|
|
| MD5 |
426673b02881479afacefa4af79799ea
|
|
| BLAKE2b-256 |
d30fca5d31c5f60e75222389a440c892e504c9783081dc1cfbe86e0db303975a
|
File details
Details for the file texttoolkitx-0.1.2-py3-none-any.whl.
File metadata
- Download URL: texttoolkitx-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec5a3874f6f00a243939106e980ebd1704dd2194d041bafe33d010e46156bc64
|
|
| MD5 |
812af0b7dcbb44ab16dbb1ee2c7cd33b
|
|
| BLAKE2b-256 |
4dc2228a3d1ee060849e43caef96d1f7f944584733f7864fdf15877bcdb68a71
|