Handy string utilities for Python
Project description
PyStringToolkit
PyStringToolkit is a lightweight and intuitive Python library offering a rich set of utilities for string manipulation and transformation. Whether you're building web applications, preprocessing text for machine learning, or just want cleaner and more readable code — this toolkit simplifies the process with clean and reusable functions.
✨ Key Features
🔠 Case Conversion Utilities
Transform strings between common naming conventions:
to_snake_case()→ Converts text tosnake_caseto_camel_case()→ Converts text tocamelCaseto_pascal_case()→ Converts text toPascalCaseto_kebab_case()→ Converts text tokebab-caseto_upper_case()→ Converts all letters to uppercaseto_lower_case()→ Converts all letters to lowercaseto_title_case()→ Capitalizes the first letter of each wordto_alternating_case()→ alternates uppercase and lowercase characters in a string
🧹 Text Cleaning Functions
Remove unwanted characters and normalize formatting:
remove_punctuation()→ Strips punctuation, preserving only letters and digitsremove_whitespaces()→ Removes all whitespaces from the stringremove_extra_spaces()→ Reduces multiple spaces to a single spacetruncate(length)→ Cuts off text after a specified length, adding ellipsiscontains_only_alpha()→ Checks if the string contains only alphabetic characters
🔧 String Generation Tools
Helpful tools for generating and formatting text:
slugify()→ Converts text into URL-friendly slugs ("Hello World!" → "hello-world")random_string(length)→ Generates a random alphanumeric string of a given length
📧 Validators
is_email()→ function validates if a string is a properly formatted email address
📦 Installation
Install the latest version via pip:
pip install pystringtoolkit
Example
from pystringtoolkit import to_snake_case
print(to_snake_case("Hello World!")) # hello_world
Contribution guide
You can find the contribution guide here to contribute in this project. Contribution Guide Thanks
Documentation
Full documentation is available here 👉 PyStringToolkit Docs
The docs include:
- Installation guide
- Usage patterns & best practices
Contributors
We value our contributors!
All the people who help improve PyStringToolkit are listed in CONTRIBUTORS.md.
A huge thanks to everyone — whether it’s code, docs, tests, or ideas 🙌
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
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 pystringtoolkit-0.1.2.tar.gz.
File metadata
- Download URL: pystringtoolkit-0.1.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1773e42ca9c0e1805ea5ba286647e9f7bb19d1e62317a13472af2b7a2fd7013
|
|
| MD5 |
eed20b4c6200f76e3fa4b2d25d9b1370
|
|
| BLAKE2b-256 |
308601b768b24d44bf2e0de82d21f44518a3064ca6360991e93631313d641c2f
|
File details
Details for the file pystringtoolkit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pystringtoolkit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98a63f78aa82c78e79c682f6e9ce35c509f7ca1d2038e04a01c42472b7e43f09
|
|
| MD5 |
63276a32d06a0de0e1a00e505c4e7b42
|
|
| BLAKE2b-256 |
da6282fc47511e27c22be2a7ac32af4d60e77194bd4a61dd34a168f74b5d5282
|