You can read Python documentation offline with pydoc3. It’s installed automatically with Python, and it always shows documentation for the version of Python you have installed.
$ pydoc3 str
You can see reference for a library ‘pydoc3 re’ or a single command ‘pydoc re.sub’. If you’re going to airplane or far, far away from the Internet, also check out my offline reference for programmers.