💾 Archived View for tris.fyi › pydoc › string captured on 2023-04-26 at 13:32:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-01-08)

-=-=-=-=-=-=-

Back to module index

Go to module by name

string

A collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable


Classes

Formatter

check_unused_args(self, used_args, args, kwargs)
convert_field(self, value, conversion)
format(self, format_string, /, *args, **kwargs)
format_field(self, value, format_spec)
get_field(self, field_name, args, kwargs)
get_value(self, key, args, kwargs)
parse(self, format_string)
vformat(self, format_string, args, kwargs)

Template

A string class for supporting $-substitutions.
safe_substitute(self, mapping={}, /, **kws)
substitute(self, mapping={}, /, **kws)
braceidpattern = None
delimiter = '



flags = re.IGNORECASE
idpattern = '(?a:[_a-z][_a-z0-9]*)'
pattern = re.compile('\n            \\$(?:\n              (?P<escaped>\\$)  |   # Escape sequence of two delimiters\n              (?P<named>(?a:[_a-z][_a-z0-9]*))       |   # delimiter and a Python identifier\n          , re.IGNORECASE|re.VERBOSE)

Functions

capwords

capwords(s, sep=None)

  capwords(s [,sep]) -> string

      Split the argument into words using split, capitalize each
      word using capitalize, and join the capitalized words using
      join.  If the optional second argument sep is absent or None,
      runs of whitespace characters are replaced by a single space
      and leading and trailing whitespace are removed, otherwise
      sep is used to split and join the words.

    

Other members

ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits = '0123456789'
hexdigits = '0123456789abcdefABCDEF'
octdigits = '01234567'
printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c'
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
whitespace = ' \t\n\r\x0b\x0c'