A fun library for playful string manipulations like leetify, uwuify, zalgo, and more!
Project description
text-chaos 🎭
A fun Python library for playful string manipulations! Transform your text with various chaotic and amusing effects like leet speak, uwu-ification, zalgo corruption, and more.
✨ Features
- 🔥 Simple API: One function call to rule them all
- 🎯 Multiple transformations: leet, uwu, drunk, mock, pirate, and more
- 📦 Extensible: Easy to add custom transformations
- 🔍 Type hints: Full typing support for better IDE experience
- 🧪 Well tested: Comprehensive test suite with pytest
- 🚀 Fast: Lightweight with no external dependencies
🚀 Installation
pip install text-chaos
📖 Quick Start
import text_chaos
# Basic usage - defaults to leet speak
text_chaos.transform("Hello World!")
# Output: "H3110 W0r1d!"
# Try different transformation modes
text_chaos.transform("Hello World!", mode="uwu")
# Output: "Hewwo Wowwd! uwu"
text_chaos.transform("Hello World!", mode="drunk")
# Output: "Helo Worrd!"
text_chaos.transform("Hello World!", mode="pirate")
# Output: "ahoy World! Arr!"
# Transform multiple strings at once
text_chaos.batch_transform(["Hello", "World"], mode="leet")
# Output: ["H3110", "W0r1d"]
# See all available transformation modes
text_chaos.get_modes()
# Output: ['leet', 'uwu', 'drunk', 'mock', 'pirate']
🎨 Available Transformations
| Mode | Description | Example |
|---|---|---|
leet |
Convert to leet speak (1337) | Hello → H3110 |
uwu |
UwU-ify text with cute speak | Hello World → Hewwo Wowwd uwu |
drunk |
Add typos and drunk typing errors | Hello World → Helo Worrld |
mock |
Add conversational fillers and pauses | This is fine → This... uhh is, like, fine |
pirate |
Transform to pirate speak | Hello friend → Ahoy matey! Arr! |
🔧 API Reference
transform(text: str, mode: str = "leet") -> str
Transform a single string using the specified mode.
Parameters:
text(str): The input text to transformmode(str, optional): The transformation mode. Defaults to "leet"
Returns:
- str: The transformed text
Raises:
ValueError: If the specified mode is not availableTypeError: If text is not a string
batch_transform(texts: List[str], mode: str = "leet") -> List[str]
Transform multiple strings using the specified mode.
Parameters:
texts(List[str]): List of input texts to transformmode(str, optional): The transformation mode. Defaults to "leet"
Returns:
- List[str]: List of transformed texts
get_modes() -> List[str]
Get a list of all available transformation modes.
Returns:
- List[str]: Available transformation mode names
🛠️ Development
Setup
# Clone the repository
git clone https://github.com/guroosh/text-chaos.git
cd text-chaos
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=text_chaos --cov-report=html
# Run specific test file
pytest tests/test_text_chaos.py -v
Code Quality
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Type checking
mypy src/
# Run all quality checks
black src/ tests/ && isort src/ tests/ && mypy src/ && pytest
🤝 Contributing
Contributions are welcome! Here's how you can help:
- Add new transformations: Create new functions in
src/text_chaos/transformers.py - Improve existing transformations: Make them funnier, more accurate, or more efficient
- Fix bugs: Check the issues tab for known problems
- Add tests: Help us maintain high code coverage
- Improve documentation: Better examples, clearer explanations
Adding a New Transformation
- Add your transformation function to
src/text_chaos/transformers.py:
def my_transform(text: str) -> str:
\"\"\"
Description of your transformation.
Args:
text: The input text to transform
Returns:
The transformed text
\"\"\"
# Your transformation logic here
return transformed_text
- Register it in the
TRANSFORMERSdictionary:
TRANSFORMERS = {
# ... existing transformers
"my_mode": my_transform,
}
-
Add tests in
tests/test_text_chaos.py -
Update this README with the new transformation
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🎉 Fun Examples
import text_chaos
# Create some chaos!
text = "Python is awesome"
print("Original:", text)
print("Leet:", text_chaos.transform(text, "leet"))
print("UwU:", text_chaos.transform(text, "uwu"))
print("Drunk:", text_chaos.transform(text, "drunk"))
print("Mock:", text_chaos.transform(text, "mock"))
print("Pirate:", text_chaos.transform(text, "pirate"))
# Chain transformations manually
chaotic_text = text_chaos.transform(text, "leet")
chaotic_text = text_chaos.transform(chaotic_text, "uwu")
print("Leet + UwU:", chaotic_text)
🌟 Star History
If you found this library useful, please consider giving it a star on GitHub! ⭐
Made with ❤️ and a bit of chaos 🎭
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 text_chaos-1.0.2.tar.gz.
File metadata
- Download URL: text_chaos-1.0.2.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a729290f09825185920b9b1d7c0596dfc0574f11266199d5436dd343469f21b1
|
|
| MD5 |
f1888c344fc9886e04b6867c5086711d
|
|
| BLAKE2b-256 |
e5b318a03de4b515414db884f68626ff544973f5023a39bfc3cdfeb69ec89467
|
Provenance
The following attestation bundles were made for text_chaos-1.0.2.tar.gz:
Publisher:
ci.yml on guroosh/text-chaos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
text_chaos-1.0.2.tar.gz -
Subject digest:
a729290f09825185920b9b1d7c0596dfc0574f11266199d5436dd343469f21b1 - Sigstore transparency entry: 494612833
- Sigstore integration time:
-
Permalink:
guroosh/text-chaos@c9f51d0e217ea7dbf3ed348b5ff5ab3386bc93a2 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/guroosh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c9f51d0e217ea7dbf3ed348b5ff5ab3386bc93a2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file text_chaos-1.0.2-py3-none-any.whl.
File metadata
- Download URL: text_chaos-1.0.2-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d925f52591fc79fc5cb8e462606e55cd2375c29e75bedaa7d0d8800829ac031e
|
|
| MD5 |
0ee194d686182bb5fbcdd1cbafae5e65
|
|
| BLAKE2b-256 |
e76cfc33a0058189c815632e776dfff275ce8f64aae5389de9662b0529c9bcf3
|
Provenance
The following attestation bundles were made for text_chaos-1.0.2-py3-none-any.whl:
Publisher:
ci.yml on guroosh/text-chaos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
text_chaos-1.0.2-py3-none-any.whl -
Subject digest:
d925f52591fc79fc5cb8e462606e55cd2375c29e75bedaa7d0d8800829ac031e - Sigstore transparency entry: 494612858
- Sigstore integration time:
-
Permalink:
guroosh/text-chaos@c9f51d0e217ea7dbf3ed348b5ff5ab3386bc93a2 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/guroosh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@c9f51d0e217ea7dbf3ed348b5ff5ab3386bc93a2 -
Trigger Event:
push
-
Statement type: