More string methods.
Project description
Letterer is more string methods. To install, use:
pip install letterer
Letterer includes the methods:
isfirstwordtitle checks to see if the first word is title:
from letterer import isfirstwordtitle
txt = 'YAY'
isfirstwordtitle(txt) #returns True
txt = 'yAY'
isfirstwordtitle(txt) #returns False
islower checks if the string is lower:
from letterer import islower
txt = 'yay'
islower(txt) #returns True
txt = 'Yay'
islower(txt) #returns False
istitle checks if an entire string is title:
from letterer import istitle
txt = 'YAY Yay'
istitle(txt) #returns True
txt = 'yAY yay'
istitle(txt) #returns False
isupper checks if a string is in upper:
from letterer import isupper
txt = 'YAY YAY'
isupper(txt) #returns True
txt = 'YAY YaY'
isupper(txt) #returns False
getupper gets the character location for uppercase letters:
from letterer import getupper
txt = 'YAY YAY'
getupper(txt) #returns [1, 2, 3, 5, 6, 7]
txt = 'YAY YaY'
getupper(txt) #returns [1, 2, 3, 5, 7]
getlower gets the character location for lowercase letters:
from letterer import getlower
txt = 'yay yay'
getlower(txt) #returns [1, 2, 3, 5, 6, 7]
txt = 'yay yAy'
getlower(txt) #returns [1, 2, 3, 5, 7]
untitle lowercases the string:
from letterer import untitle
txt = 'Hello World!'
untitle(txt) #returns hello world!
txt = 'HELLO WORLD!'
untitle(txt) #returns hELLO wORLD!
checknum is an optional parameter for istitle, islower, and isupper. It tells how many charaters (words for istitle) into the string (spaces aren't counted):
from letterer import isupper
#is the same for istitle, and islower.
txt = 'YAY YAY'
isupper(txt,6) #returns True
txt = 'YAY YaY'
isupper(txt,4) #returns True
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
File details
Details for the file letterer-0.0.2.tar.gz
.
File metadata
- Download URL: letterer-0.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e1d477f3a5b3b37b3035596309a955620d97fa9d42cd14a66e1a79a17263a3 |
|
MD5 | 7e198fc1773ad0a66840644f433c2c69 |
|
BLAKE2b-256 | 50449b42989c9ab079403487655df0196d4494f7056c69b3d59eca4fe3f594a6 |
File details
Details for the file letterer-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: letterer-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfd69e43bd4d36eeb2621ad1b4c94e1f0edcd83f9d8bb1262f86ddebbdc77d0a |
|
MD5 | bfb9acee84874d9506bb1a796b88378b |
|
BLAKE2b-256 | 31aaf27bf26abd705f90494df2a65910eef9093de9fc1d8ba14919ada7dcdc5d |