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 word
🧹 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
📦 Installation
Install the latest version via pip:
pip install pystringtoolkit
Example
from pystringutils import to_snake_case
print(to_snake_case("Hello World!")) # hello_world
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.1.tar.gz.
File metadata
- Download URL: pystringtoolkit-0.1.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e57759530c6c8b1177ca06351dce4144d612085a22ad16fa3b107fcd26dfdfcc
|
|
| MD5 |
b0ab3e280e5672ac6bfb4c8f1b000403
|
|
| BLAKE2b-256 |
aaf162958e206a26a561affc6f59f2587e08382a37191346966e63e2768433d2
|
File details
Details for the file pystringtoolkit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pystringtoolkit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.2 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 |
5f2a7d1fec3ac4a24376d273b5d30e9935e563f982fc15fdeff6a3d75f40ba1f
|
|
| MD5 |
ef7e4074319e729cb288bb0a83d123a0
|
|
| BLAKE2b-256 |
ecbfb08c29b9a905ba6e9cdc5e1736214e54bd17ad0ab9b1fa19a37397f4d010
|