library (we will look at two such modules later onthe pyparsing and ply modules that are used to create parsers in in this section we present broad overview of what is on offertaking thematic approachbut excluding those packages and modules that are of very specialized interest and those which are platform-specific in many cases small example is shown to give flavor of some of the packages and modulescross-references are provided for those packages and modules that are covered elsewhere in the book string handling |the string module provides some useful constants such as string ascii_letters and string hexdigits it also provides the string formatter class which we can subclass to provide custom string formatters the textwrap module can be used to wrap lines of text to specified widthand to minimize indentation the struct module provides functions for packing and unpacking numbersbooleansand strings to and from bytes objects using their binary representations this can be useful when handling data to be sent to or received from lowlevel libraries written in the struct and textwrap modules are used by the convert-incidents py program covered in the difflib module provides classes and methods for comparing sequencessuch as stringsand is able to produce output both in standard "diffformats and in html python' most powerful string handling module is the re (regular expressionmodule this is covered in the io stringio class can provide string-like object that behaves like an in-memory text file this can be convenient if we want to use the same code that writes to file to write to string examplethe io stringio class python provides two different ways of writing text to files one way is to use file object' write(methodand the other is to use the print(function with the file keyword argument set to file object that is open for writing for exampleprint("an error message"file=sys stdoutsys stdout write("another error message\ "the term subclassing (or specializingis used for when we create custom data type ( classbased on another class gives full coverage of this topic bytes type the struct module