For the time-crunched, in-need-of-a-quick-fix reader: This is an excellent, much-needed book. If you want to do network programming with Python or, for that matter, any scripting language (as many of the concepts here are basic, essential, and adaptable) buy this book and be happy. With clear code examples, concise text, and insightful attention to the needs of the target audience -- practical programmers in need of a quick intro -- John Goerzen dispenses with the dross and gives the reader a head-first survey of network programming.
The book's title hits the target audience but doesn't, however, precisely characterize the thrust of the text. "Foundations" implies a broad structure on which to build and this book certainly addresses network programming in a broad sweep. Yet the book had a feel more accurately described as "learning by example" than a "foundations" approach might traditionally imply. Basic concepts are given a cursory overview, but if you wish to get to the nitty gritty details of sockets, protocols or network services then look for that sort of foundation elsewhere. Here you will, instead, get a few terms covered in just a few pages and then you're presented with working examples of Python code.
By no means should this be construed as an overall weakness. This observation is only made in order to clarify Foundation's approach: quick and cut-to-the-chase. Chapters are short, averaging a little over 19 pages, and the overall feel is that of a "cookbook" with an emphasis on gentle explanation. If what you want is to get up and running, leaving small details for later if necessary, then you've come to the right place. But perhaps "Python Network Programming by Example", or "The Joy of Python Network Programming", would be more fitting.
The author, who has been a member of the Debian GNU/Linux development team since 1996 (the Unix/Linux bias shows slightly here, with some space devoted to to inetd and forking), does the learn-by-doing reader a great favor by providing copious working examples of readily grasped code which cover straightforward solutions to typical problems or situations with an emphasis -- a very nice emphasis -- on error-checking and recovery from the various hiccups of network programming. Nothing teaches like good code with astute attention paid to explaining key concepts and usual corner cases, and this is the case here.
The writing style is a little dry. That said, the prose is both clear and concise and does a good job of speedily presenting new, potentially tricky concepts, another notable strength. Chapters five, "Advanced Network Operations", and seven, "XML and XML-RPC", are both good examples.
The first five chapters, which form the first section, "Low-Level Networking", get the reader started with sockets, servers, and DNS. These are probably the only essential chapters of the book, especially if the reader is new to these topics, in that they reveal Python's general approach to networking within the standard library. After that the reader would do well to, more or less, hop around among the remaining chapters as needed. Part Two covers Web services, with some nice coverage of XHTML and XML parsing. Part Three addresses E-mail services: MIME, SMTP, POP, and IMAP. Part Four takes a general shot at FTP, database clients, and (a very brief) chapter on SSL. Part Five is on server-side frameworks, covering a three items, SocketServer, SimpleXMLRPCServer, and CGI, all which come as standard modules, along with an introduction to mod_python, which does not. Part Six is on multitasking, lending an overview of threading and forking, and asynchronous communication.
That's a lot. Some subjects, like SSL and async, can't be covered in a great deal of detail given the space provided, and if this is your first exposure to these topics, you'll be left wanting. But you will be effectively introduced.
The Twisted Framework (http://www.twistedmatrix.com) is discussed in Chapter 12, IMAP, which is nice, and is touched on again in the final chapter on async. It would have been nicer to see some more Twisted coverage, since Twisted is one of the most elegant and distinctly Pythonic approaches to networking, but there's material available on the Web and, again, this gets you pointed in the right direction.
The only final criticism that might be leveled about the book is that, at times, some of the approaches don't seem particularly "Pythonic". The database client chapter, for example, doesn't cover the common Python approach of operater overloading, such as overloading __getitem__ in order to wrap a SQL SELECT statement. In this and certain other parts of the book, if you are not new to some only moderately advanced concepts in Python, then the reader will be able to see where certain choices were made between the notions of "Foundations" (and how foundational to be) and "Python" (and just how pythonic to get).
Criticisms aside, this is a fine book, and a fine complement to Apress's rather excellent "Diving Into Python" by Mark Pilgrim. "Foundations" fills a fundamental need for this information to be aggregated into a cohesive resource, and the book's no-nonsense, effective approach should win over both new Python converts looking to implement their first network client or Web site, or experienced Pythonistas who desire quick information at their fingertips. I thoroughly enjoyed this book and I heartily recommend it.