Free Books for Learning Python
Tags: python, programming
Published: 2020-11-06 02:11:49

Python tutorials abound. Sometimes, though, I want to feel like I am reading a consolidated and comprehensive volume of information about Python. In other words, a book.

How do I define "book"? A full-length multi-chapter resource that reads like a printed book. Very satisfying, especially if the quality-to-price ratio is pleasantly high.

The following good books are available to read online and, in some cases, to download. For free.

> Please note that many of these free online books are also available in print, for a cost. Follow the links to find ways of purchasing print books that support the authors.

## [Downloadable Official Python Docs](https://docs.python.org/3/download.html)

[![Python logo](https://www.python.org/static/community_logos/python-logo-master-v3-TM-flattened.png)][download]

While I wouldn't normally classify the Python docs as a book, the downloadable version looks and reads like one. It is available in HTML, PDF, and even plain text and ePub formats.

**Audience**: Anyone, from beginner to veteran, will benefit from having the Python docs close at hand.

**Strengths**: Comprehensive and detailed, and also includes tutorials and examples.

**Topics**: All of them! Not surprisingly, though, rarely are 3rd party libraries and tools mentioned.

## [Automate the Boring Stuff with Python][automate]

[![Automate the Boring Stuff with Python](https://dev-to-uploads.s3.amazonaws.com/i/5mywcdk2uoum67b76l15.png)][automate]

> Hint: after [clicking on the link][automate], scroll down until you find the table of contents!

This is one of several excellent books by Al Sweigart, and has long served as an introduction for many newcomers to Python. That said, the practical nature of this resource serves any student of the language, old or new, and encourages all of us to think about repetitive tasks we might automate to make life more enjoyable.

**Audience**: Those new to Python, data jockeys of all sorts, system administrators, and anyone looking for creative solutions for everyday tasks.

**Strengths**: Practical, approachable. Did I mention practical?

**Topics**: Python basics, CSV, PDF, Excel, web scraping, images, email, debugging, and more.

## [The Hitchhiker's Guide to Python][hitchhikers]

[![The Hitchhiker's Guide to Python](https://dev-to-uploads.s3.amazonaws.com/i/pozk1qnmzj1naz25b8tz.jpg)][hitchhikers]

This creative, readable, and constantly updating guide comes from Kenneth Reitz, who also authored [requests](https://requests.readthedocs.io/), one of the most popular HTTP libraries for Python. While the guide introduces Python and the standard library, it is notable for the many third party libraries and tools described.

**Audience**: Those new to Python, as well as those brushing up and interested in exploring the breadth of use cases and solid 3rd party tools and libraries for Python

**Strengths**: Practical, enjoyable, broad.

**Topics**: Python basics, installation, virtual environments, project structure, coding style, documentation, packaging, GUI development, command line interface development, and much more.

## [Think Python][think]

[![Think Python 2nd edition](https://dev-to-uploads.s3.amazonaws.com/i/0cvj5uxk8jlxpa8aczi8.jpg)][think]

[Think Python: How to Think Like a Computer Scientist][think], by Allen B. Downey, provides a wonderful hybrid approach of a practical introduction to Python combined with computer science principles. As someone who does not have a computer science degree, I find that this book fills in some gaps in my knowledge, while still being approachable and avoiding unnecessary academic trivia. The writing is personal and informative.

**Audience**: Pythonistas learning computer science, computer science students learning Python, anyone who wants to learn Python and dig a bit into computer science.

**Strengths**: Readable, thorough, brainy

**Topics**: Python syntax, structure, and computer science paradigms

## [A Byte of Python][byte]

[![A Byte of Python](https://dev-to-uploads.s3.amazonaws.com/i/xrkjmq9ns7mfz6ir64z4.jpg)][byte]

[A Byte of Python][byte] by Swaroop C H is a sweet, elegant, understandable introduction to Python. Easy yet rich. It is the haiku of Python texts. The book has also been [translated](https://python.swaroopch.com/translations.html) into a variety of languages.

**Audience**: Those new to Python and those needing a refresher. Or if you simply enjoy a kind and thoughtful book.

**Strengths**: Easy to understand, gentle, thorough

**Topics**: Python fundamentals and problem solving

## [Architecture Patterns with Python (Cosmic Python)][cosmic]

[![Architecture Patterns with Python: Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices](https://dev-to-uploads.s3.amazonaws.com/i/kkx5ojepm23lz38kyrs9.jpg)][cosmic]

[This book's][cosmic] authors Harry J.W. Percival and Bob Gregory are eager to engage problems posed by enterprise-grade software complexity. They believe the Python community is ripe for the facing of such issues, and they are convincing. This book, then, focuses on software architecture and testing, including a methodology titled "Domain Driven Design." The authors provide a blend of practical problem-solving and consideration of applicable design patterns.

**Audience**: Intermediate to advanced Python developers who may not be familiar with Domain Driven Design

**Strengths**: Explains deep concepts in thorough but understandable ways, introduces advanced design concepts

**Topics**: Test Drive Development, Domain Driven Design, microservices

## [Problem Solving with Algorithms and Data Structures using Python][pythonds]

[![Problem Solving with Algorithms and Data Structures using Python](https://dev-to-uploads.s3.amazonaws.com/i/p6qlkc8p73hahfj1j3fd.jpg)][pythonds]

Another great book that introduces Python and computer science concepts, [Problem Solving with Algorithms and Data Structures using Python][pythonds] is unique in that it is interactive. Bradley N. Miller and David L. Ranum have provided both text and code examples that are editable and runnable. As you might be able to tell from the title, there is a strong emphasis on how Python manages data. Readers will take a deep dive into data types and the storing and structuring of data while using Python. Algorithms get attention as well. As noted before, I was not a Computer Science major, and this book helps me understand, finally, what people mean when they talk about a "bubble sort."

**Audience**: Those new to Python and computer science, or those with some familiarity with either, hoping to improve.

**Strengths**: Classic concepts, topically diverse, smart.

**Topics**: Data structures, algorithms, fundamentals of Python

## [Python Data Science Handbook][datascience]

[![Python Data Science Handbook](https://dev-to-uploads.s3.amazonaws.com/i/6j8kzci1ktiygelbu7z3.png)][datascience]

I learned Python for system administration and web development. Many, many Python users, however, grew into Python because of the robust Python ecosystem around data science and machine learning. If you are like me, and data science is an alien planet, this book will help. Or, on the other hand, if you are dabbling in data science, and want to know how Python can help you dig in, it is a good fit for that, too. Jake VanderPlas does an excellent job getting us hands on and familiar.

**Audience**: Those already familiar with Python and/or programming, hoping to learn tools for data science

**Strengths**: nerdy and practical

**Topics**: Numpy, Pandas, Matplotlib, machine learning, and other hip subject matter

## [How To Code in Python][dobook]

[![How To Code in Python](https://dev-to-uploads.s3.amazonaws.com/i/sm2j1cinp8ys9ykv7o90.png)][dobook]

If [How to Code in Python][dobook] feels remarkably "digestable" to you, that may be because it was written in bite-sized pieces. Originally [a blog/tutorial series][dotutorial], Digital Ocean provides this series of introductory articles in downloadable book form as well, both as a [PDF][dopdf] and even an [ePub][doepub].

**Audience**: Those new to Python, as well as those brushing up.

**Strengths**: Practical, digestable, pleasant

**Topics**: Python basics, installation, debugging logging, data types, hints and tips.

## [Python for You and Me][youandme]

[![Python for You and Me](https://dev-to-uploads.s3.amazonaws.com/i/msbxft9afna3egc3qjuj.jpg)][youandme]

Do you appreciate "physical computing" (Arduino, Raspberry Pi, LEDs, and the like), or want to dive into web development right away? If not, [Kushal Das's book][youandme] is still a readable and succinct introduction to Python you may enjoy. But if you do appreciate circuit boards and similarly hands-on activities, then it has even greater value. It offers experience with such tools as CircuitPython, Flask and Pypercard, and dwells on other topics I do not usually see included in other books.

**Audience**: Those new to Python

**Strengths**: step-by-step pace, contains variety

**Topics**: Python fundamentals, editors, PEP8, testings, NeoPixels, command line interfaces.

## [Intermediate Python][intermediate]

[![Intermediate Python](https://dev-to-uploads.s3.amazonaws.com/i/093thdu9pzx7l016jsc1.png)][intermediate]

Seeking to fill the gap between introductory documentation and advanced principles and practice, Yasoob Khalid wrote the appropriately named [Intermediate Python][intermediate]. I love his inclusion of functional paradigms, comprehensions/generators, and even a clever chapter on "one-liners." Seeing his chapter on ternary operators initially made me cringe, as Python doesn't have them. However, upon further reading, I rather enjoyed the patterns he demonstrated there, and felt that I was learning to think creatively.

**Audience**: Intermediate Python developers. Surprising, right?

**Strengths**: advanced yet understandable concepts, unique among Python programming books

**Topics**: Debugging, exception handling, functional programming, mutable/immutable types, and much more.

## [Functional Programming in Python][functional]

[![Functional Programming in Python](https://dev-to-uploads.s3.amazonaws.com/i/4ug58agfw1rwzsetddep.png)][functional]

Python favors [object-oriented programming](https://en.wikipedia.org/wiki/Object-oriented_programming), right? If you want functional go use [Haskell](https://www.haskell.org/) or [Elixir](https://elixir-lang.org/) or one of many others.

Well, not necessarily. Python is flexible enough to accommodate functional programming and paradigms, to some degree. O'Reilly makes [David Merz's book available as a freely downloadable PDF][functional]. Take a look if you want to get your feet wet with functional programming.

**Audience**: Those somewhat familiar with Python who are interested in functional programming.

**Strengths**: Thoughtful and fresh. And functional.

**Topics**: Functional programming.

## Other free books?

Do you have other free book suggestions? Please post a comment!

[automate]: https://automatetheboringstuff.com/
[byte]: https://python.swaroopch.com/
[cosmic]: https://www.cosmicpython.com/
[datascience]: https://jakevdp.github.io/PythonDataScienceHandbook/
[dobook]: https://www.digitalocean.com/community/books/digitalocean-ebook-how-to-code-in-python
[doepub]: https://do.co/python-book-epub
[dopdf]: https://do.co/python-book-pdf
[dotutorial]: https://www.digitalocean.com/community/tutorial_series/how-to-code-in-python-3
[download]: https://docs.python.org/3/download.html
[functional]: https://www.oreilly.com/programming/free/files/functional-programming-python.pdf
[hitchhikers]: https://docs.python-guide.org/
[intermediate]: https://book.pythontips.com/
[python-notes]: https://books.goalkicker.com/PythonBook/
[pythonds]: https://runestone.academy/runestone/books/published/pythonds3/index.html
[think]: https://greenteapress.com/wp/think-python-2e/
[youandme]: https://pymbook.readthedocs.io/
[dive]: https://diveintopython3.problemsolving.io/
[github]: https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md#python