Python package for playing with strings
Project description
string-decorator
Python Module to have fun with strings
Usage
Example 1 -> Calculating expression from given string
from string_decorator import calculate
print(calculate("(123+23) * 23 / 32"))
Output
104.9375
Example 2 -> Validating text based on given conditions
from string_decorator import validate_text
print(validate_text("imEternity1234@strings", length = 13, uppercase = 1, lowercase = 5, numbers = 4, special_characters=1))
Output
True
Example 3 -> Converting the string to random cases
from string_decorator import randcase
print(randcase("hello"))
Output
hELlO
Example 4 -> Extracting numbers from the given string
from string_decorator import num_extract
print(num_extract("hello123 23,211 42.23 -134 g00d"))
Output
['123', '23,211', '42.23', '-134', '00']
Documentation
Name | Description |
---|---|
randcase |
Changes the given text to random cases (upper or lower) |
snakecase |
Changes the given text to snake_case |
constantcase |
Changes the given text to CONSTANT_CASE |
kebabcase |
Changes the given text to kebab-case |
headercase |
Changes the given text to PascalCase |
camelcase |
Changes the given text to camelCase |
dotcase |
Changes the given text to dot.case |
pathcase |
Changes the given text to path/case |
swapcase |
Changes each upper characters to lower and vice versa |
scramble_sentence |
Returns the sentence in random order Eg: 'Hello my friend' might change to 'my friend Hello' |
sentence_reverse |
Reverses given sentence Eg: 'Hello world' changes to 'world Hello' |
random_string |
Generates a random string comprising of lower cased or upper cased characters, numbers, symbols |
str_encode |
Encodes the given text into bytes format |
bytes_decode |
Decodes bytes back to string |
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
string-decorator-0.2.5.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for string_decorator-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bc97748f58dd40cfbd0294a7c31947c0cb15e1e66007d782caaf856c0db8964 |
|
MD5 | fd1e85afff925ab40fbad2f5f93e2502 |
|
BLAKE2b-256 | 7e7cd8bdc3d51b96ea84c67387e1a8c3713ab66af531865dc99b56181d5d6d83 |