Skip to main content

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


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)

Uploaded Source

Built Distribution

letterer-0.0.2-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page