PyMOTW: struct

The struct module includes functions for converting between strings of bytes and native Python data types such as numbers and strings.

Read more at pymotw.com: struct