Goodreads helps you keep track of books you want to read.
Start by marking “Python Cookbook” as Want to Read:
Python Cookbook
Enlarge cover
Rate this book
Clear rating
Open Preview

Python Cookbook

4.16  ·  Rating details ·  890 ratings  ·  40 reviews
If you need help writing programs in Python 3, or want to update older Python 2 code, this book is just the ticket. Packed with practical recipes written and tested with Python 3.3, this unique cookbook is for experienced Python programmers who want to focus on modern tools and idioms.

Inside, you’ll find complete recipes for more than a dozen topics, covering the core Pyth
Paperback, 3rd Edition, 706 pages
Published May 29th 2013 by O'Reilly Media (first published July 15th 2002)
More Details... Edit Details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about Python Cookbook, please sign up.

Be the first to ask a question about Python Cookbook

Community Reviews

Showing 1-30
Average rating 4.16  · 
Rating details
 ·  890 ratings  ·  40 reviews

More filters
Sort order
Start your review of Python Cookbook
Aug 08, 2007 rated it liked it  ·  review of another edition
Shelves: _owned, read-enough
Lots of practical recipes for using Python more effectively.

Just to clarify for certain of my friends (you know who you are!):
* Python is a popular computer language, named after "Monty Python's Flying Circus", a British TV comedy
* The O'Reilly Cookbook series uses the metaphor of cooking to present a collection of small, practical solutions ("recipes") to specific programming problems.

Hence, despite my misleading lead-in, the Python Cookbook has nothing to do with preparing snakes for human c
Mark Pergamenshik
May 08, 2018 rated it it was ok
As a Java programmer that wants to learn Python this book was OK.
There are some good recipes but most of the book (about 85%) can be summarized in one sentence "You want to do some job, find third party library to do it for you"
Especially annoying that in some recipes the section ends with something like "there are some better libraries to do this job so use them and not the suggested in recipe?!?!?!"
Some of the recipes are very basic and can be summarized in few lines but in many cases those re
Jul 07, 2013 rated it it was amazing
Shelves: computer
The third edition of Python Cookbook is part of what seems to be a general trend of issuing new editions focusing on Python 3. For me, whose focus is on data analysis and technical computing, this is the time to be thinking about the change from Python 2 to Python 3 as the base libraries of Numpy, Scipy, Matplotlib, and iPython have been ported, and the various other libraries I use that depend on these are being ported as well. But this edition is not just porting the old cookbook, it is a comp ...more
Jeanne Boyarsky
Jun 16, 2013 rated it it was amazing
Shelves: technology
The “Python Cookbook” (3rd edition) is over 600 pages full of content. The recipes vary extensively in difficulty and scope. From simple string concatenation to writing a (BNF) recursive decent parsers.

The book covers Python 3.3. The authors warn some recipes aren't backward compatible with 2.X. While I would have liked more on the transition, I'm not a Python developer – I just do some scripts. It's entirely possible nobody cares about compatibility.

My favorite recipe was on CSV. Paring was sh
Nov 22, 2016 rated it it was amazing
I really liked this book, I learned a lot of Python 3 without even realizing it. When I sat down for a Python 3 project, the new stuff was all second-nature. It covers tons of disparate applications, some of which were over my head. It's a great reference. ...more
Dec 24, 2013 rated it it was amazing  ·  review of another edition
This is idiomatic Python. This book is made all the more enticing by the fact that it focuses on using Python 3. At the time of its publication, it was the best resource for learning how to write lean code using the features available in Python 3. At the time of my writing this review, it is still *the* book I'd recommend for that purpose.

Go get it, and read it twice. Your Python will thank you. :)
Aug 07, 2017 rated it it was amazing
Recommends it for: advanced, beginner (only first few recipes in chapter)
Great book! A must-have on work desk.

It is so well structured: chapters grouped by programming techniques or domain tasks and each chapter has recipes ordered by complexity level. This makes the book good even for not-so-begginer Python programmers, they can just read first 5 recipes in each chapter or read chapter until they start having problems with smooth reading and understanding.
The recipes include only starndard library ingredients however alternative 3rd party tools are also mentioned. T
Mark Eccles
Aug 08, 2020 rated it really liked it  ·  review of another edition
I am a part time Python programmer, using it for simple uses cases such as log file parsing, serving RESTful APIs, and machine learning pipelines. This book was an interesting read. I picked up a lot of new knowledge of some of Python's popular modules and language features. Most interesting was the sections on iterators, generators, context managers, and classes. These are done slightly different in Python compared with other languages like Java, so very helpful for someone experience with prog ...more
David Celjuska
Nov 28, 2018 rated it really liked it
It is a good reference book. I read half of the book chapter after chapter and then I pick what was interesting. It is a book to come back. I would prefer if the book had some basic introduction to Python for beginners. I have programming background in C++, Java, PHP, Scala, but haven't had that, it would be way too difficult to go thought. There are many topics and terms that are not explained: closures, packages, lambda, etc. so some basics are required. ...more
Aug 07, 2017 rated it really liked it  ·  review of another edition
This is a great tour through the "fancier" tools available in Python.

(What are generators and iterators and why would you use them? Are there elegant built-in tricks for string parsing and data structures? etc.)

It's structured as "problem: solution!" and is very dense but clear. Works either for reading cover-to-cover and using as a reference.
Jul 29, 2018 rated it really liked it
Shelves: tech
Very useful. An excellent reference. Essential even.

I also recommend reading it cover to cover. That is tough going (it’s an all-encompassing tome) and will take some time. However it’s incredibly valuable for helping shrink the space of unknown unknown best practices in Python. “Oh wait, isn’t there a better way of loading package data files... yes, that’s right...”
Dec 01, 2018 rated it it was amazing
Excellent material for acing for python skill. This is not for beginners though. You need to have some hands on experience in python to grasp the material. Different recipes to help you understand the advanced concept of the language. This book will make your day job easier. Highly recommended for anyone want to perfect python skill.
Stephen Cook
Apr 03, 2019 rated it really liked it
Excellent compendium of Python recipes and idioms. Particularly useful for experienced programmers who want to become proficient quickly with Python but avoid importing assumptions from other languages.
Mahmud Ahsan
Mar 28, 2018 rated it it was amazing  ·  review of another edition
Very good book to know about some quick solution for common problems.
Sep 18, 2019 added it
It will be useful for me to learn python
Kalyan Tirunahari
Mar 07, 2020 rated it really liked it
Shelves: coder
If you are at an intermediate level to Python and want take it to advanced level this is the right book for you. Tons of relevant examples.
Sep 01, 2010 rated it really liked it  ·  review of another edition
Shelves: tech, guide, programming
I'm glad to be done with this for now, as I am with most books intended for reference use that I try reading cover to cover. Nevertheless it's a great resource, and I think the recipes here are a bit higher quality than some of the other O'Reilly Cookbook titles. Good cross-referencing and encouragement to refer to material in related chapters. An essential reference if you are learning Python, and a source for some great ideas. ...more
Dave Peticolas

This Python programming cookbook lives up to the standard set by the excellent Perl Cookbook. In addition, this book is associated with a website where the programming recipes were originally collected from Python users. The website continues to grow and collect new recipes and thus represents a great resource for Python programmers.

Eric Casteleijn
Sep 19, 2015 rated it really liked it
A solid Python reference, containing recipes for many common tasks. A valuable addition to any Pyhonista's library.

If I had to find fault with anything it's that the code samples could use a little cleaning up. The coding style is inconsistent (understandably with two authors), and not always in agreement with generally accepted best practices (pep8). I feel running the examples through a linter would have fixed that, but it's immaterial to the utility of individual examples.
Oct 03, 2014 rated it it was amazing
I think there is no option as 'currently-reading' and 'read', because you reference to that book and collecting knowledge step by step. And i can say that this book is really good cookbook, maybe python as a language makes it much better as it would be with another language, but anyway. It's really good one! ...more
May 29, 2007 rated it it was amazing  ·  review of another edition
Recommends it for: Python programmers
Shelves: computers, python
I love the cookbook series. Lots of clever tricks and details about the language you didn't know before. Plus I have to recommend this because recipe 7.3 "Using Compression with Pickling" is the first thing I've ever had published in a book. ...more
May 04, 2014 rated it it was amazing
This is guide book with interesting and unexpected examples and trics. Best approach - reading chapter, which has actually information for you current task.

Third (3) edition is best, don't read previous versions.
Anton Antonov
Mar 05, 2015 rated it it was amazing
Shelves: technical
A must-have for every Python developer aiming to code in the most Pythonic way.

The authors' discussions, approaches and solutions to problems are way better than what the current Python docs can offer. I found it most useful for Iterators, Generators and Meta-programming.
Andrew Montalenti
the book that taught me that Python is highly practical
Nov 05, 2012 rated it liked it  ·  review of another edition
Shelves: partially-read
Partially usable, definitely a cookbook is not for me...
For a software recipe I just prefer StackOverflow.
Nov 24, 2012 rated it it was ok  ·  review of another edition
It's just 'okay' as far as a python cookbook is concerned. Aids programming practice, but lacks subtle qualities of a readable text. ...more
Mar 15, 2013 rated it it was amazing
Shelves: oreilly
Excellent book! Really learned a lot from it.
Jul 23, 2013 rated it it was amazing
Shelves: professional
Perfect book for the non-newbie. Clear and well explained recipes for typical problems.
Chris Sosa
Good as a reference book but not that great otherwise
May 13, 2014 rated it it was amazing
Shelves: python
Very recommended for every python developer.
Most of the receipts stands for their own and shows, with clear explanations, how to achieve selected goals using elegant, readable, code.
« previous 1 next »
There are no discussion topics on this book yet. Be the first to start one »

Readers also enjoyed

  • Fluent Python: Clear, Concise, and Effective Programming
  • Learning Python
  • Clean Code: A Handbook of Agile Software Craftsmanship
  • Pro Git
  • Introduction to Algorithms
  • Effective Python: 90 Specific Ways to Write Better Python (Effective Software Development Series)
  • Designing Data-Intensive Applications
  • Programming Python
  • Code: The Hidden Language of Computer Hardware and Software
  • Effective Python: 59 Specific Ways to Write Better Python
  • Think Python
  • The Pragmatic Programmer: From Journeyman to Master
  • Python for Data Analysis
  • Cracking the Coding Interview: 150 Programming Questions and Solutions
  • Design Patterns: Elements of Reusable Object-Oriented Software
  • Python Machine Learning
  • Python Testing with Pytest: Simple, Rapid, Effective, and Scalable
  • The Clean Coder: A Code of Conduct for Professional Programmers
See similar books…

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »

Related Articles

San Francisco is a gold rush town. There aren’t many books about people in their 20s who move to Silicon Valley with dreams of earning a living...
33 likes · 1 comments
“words = [    'look', 'into', 'my', 'eyes', 'look', 'into', 'my', 'eyes',    'the', 'eyes', 'the', 'eyes', 'the', 'eyes', 'not', 'around', 'the',    'eyes', "don't", 'look', 'around', 'the', 'eyes', 'look', 'into',    'my', 'eyes', "you're", 'under' ] from collections import Counter word_counts = Counter(words) top_three = word_counts.most_common(3) print(top_three) # Outputs [('eyes', 8), ('the', 5), ('look', 4)]” 0 likes
More quotes…