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
letterer-0.0.2.tar.gz
(3.2 kB
view hashes)