Searching for the best legally free Python books can be overwhelming with so many broken links and outdated resources. This curated list provides over 80 high-quality, legal, and free Python programming books covering everything from absolute beginner basics to advanced machine learning and internals.
Quick Summary: Top Recommended Free Python Books
| Book Title | Level | Primary Focus | Format |
|---|---|---|---|
| Think Python 2e | Beginner | Computer Science Fundamentals | PDF/HTML |
| Automate the Boring Stuff | Beginner | Practical Task Automation | HTML |
| A Byte of Python | Beginner | Language Basics | HTML/PDF |
| Intermediate Python | Intermediate | Advanced Features & Idioms | PDF/HTML |
| Test-Driven Development | Advanced | Web Dev & Software Quality | HTML |
Why Trust This List?
Unlike many “100+ free books” lists that include illegal pirated copies or outdated Python 2 materials, this collection is strictly: 1. Legal: Authorized by authors or publishers for free distribution. 2. Modern: Focused on Python 3. 3. Vetted: Skimmed for quality and educational value.
Table of Contents
- Introductory Materials
- Continuation
- Projects-Based
- Correct Way
- Internals
- Software Engineering
- TDD
- OOP
- Functional Programming
- Text Processing
- Cryptography
- Web
- Games
- Data Structures and Algorithms
- Data Science
- Computer Vision
- Visualisations-Focused
- Distributed Systems
- Machine Learning & Deep Learning
- Natural Language Processing
- Porting to Python3
- Miscellaneous
- Frequently Asked Questions
INTRODUCTORY MATERIALS
Think Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Allen Downey
- Why It’s Valuable: Think Python is an introduction to computer science and programming intended for people with no prior experience. it guides you through the basic concepts of programming before moving on to functions, recursion, and data structures.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: http://greenteapress.com/thinkpython2/thinkpython2.pdf
Python Practice Book
- Level: Beginner
- Focus: Introductory Materials
- Author: Anand Chitipothu
- Why It’s Valuable: This book is prepared from the training notes of Anand Chitipothu.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://anandology.com/python-practice-book/index.html
Practical Python Programming
- Level: Beginner
- Focus: Introductory Materials
- Author: David Beazley
- Why It’s Valuable: Highly recommended book. Normally taught in 3/4 days. It offers solid foundations. This course is taught to scientists and engineers. The name of the author is a trademark of excellence. Do read it even if you already know Python!
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://dabeaz-course.github.io/practical-python/Notes/Contents.html
Learn Python Programming - Second Edition
- Level: Beginner
- Focus: Introductory Materials
- Author: Fabrizio Romano - Packt
- Why It’s Valuable: Learn Python Programming is a quick, thorough, and practical introduction to Python - an extremely flexible and powerful programming language that can be applied to many disciplines. You will begin by learning the fundamentals of Python so that you have a rock-solid foundation to build upon. Covers some data science, GUI and web (Django).
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://www.packtpub.com/free-ebooks/learn-python-programming-second-edition
Dive Into Python 3
- Level: Beginner
- Focus: Introductory Materials
- Author: Mark Pilgrim
- Why It’s Valuable:
A book published by Apress covering beginner topics including a special focus on generators and iterators. Contributed by
u/ou_ryperd. - Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://diveintopython3.net/
Python For Everybody
- Level: Beginner
- Focus: Introductory Materials
- Author: Charles R. Severance
- Why It’s Valuable: The goal of this book is to provide an Informatics-oriented introduction to programming. The primary approach taken in this book is using Python to solve data analysis problems common in the world of Informatics.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: http://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf
Python 3 Basics Tutorial
- Level: Beginner
- Focus: Introductory Materials
- Author: Dr. Kristian Rother
- Why It’s Valuable: The perfect introduction for completely new people.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://krother.gitbooks.io/python-3-basics-tutorial/content/en/
Non-Programmer’s Tutorial for Python 3
- Level: Beginner
- Focus: Introductory Materials
- Author: Josh Cogliati
- Why It’s Valuable: The Non-Programmers’ Tutorial For Python 3 is a tutorial designed to be an introduction to the Python programming language. This guide is for someone with no programming experience.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_3
The Coder’s Apprentice
- Level: Beginner
- Focus: Introductory Materials
- Author: Pieter Spronck
- Why It’s Valuable: “The Coder’s Apprentice” aims at teaching Python 3 to students and teenagers who are completely new to programming. Contrary to many of the other books that teach Python programming, this book assumes no previous knowledge of programming on the part of the students, and contains numerous exercises that allow students to train their programming skills.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: http://www.spronck.net/pythonbook/pythonbook.pdf
A Practical Introduction to Python Programming
- Level: Beginner
- Focus: Introductory Materials
- Author: Brian Heinold
- Why It’s Valuable: The book aims at striking the balance between a tutorial and reference book. Includes some fun exercises at the end!
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://www.brianheinold.net/python/python_book.html
A Byte of Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Swaroop C H
- Why It’s Valuable: “A Byte of Python” is a free book on programming using the Python language. It serves as a tutorial or guide to the Python language for a beginner audience. If all you know about computers is how to save text files, then this is the book for you.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://python.swaroopch.com
Intermediate Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Muhammad Yasoob Ullah Khalid
- Why It’s Valuable: Python is an amazing language with a strong and friendly community of programmers. However, there is a lack of documentation on what to learn after getting the basics of Python down your throat. Through this book I aim to solve this problem. I would give you bits of information about some interesting topics which you can further explore. The topics which are discussed in this book open up your mind towards some nice corners of Python language. This book is an outcome of my desire to have something like this when I was beginning to learn Python. If you are a beginner, intermediate or even an advanced programmer there is something for you in this book. Please note that this book is not a tutorial and does not teach you Python. The topics are not explained in depth, instead only the minimum required information is given. A true example of legally free Python books.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://buildmedia.readthedocs.org/media/pdf/intermediatepythongithubio/latest/intermediatepythongithubio.pdf
Boxes: Your Second Python Book
- Level: Beginner
- Focus: Introductory Materials
- Author: Roberto Alcina
- Why It’s Valuable: This book tries to achieve only one thing: Show you a project go from nothing to OK. By nothing I mean, no code at all. Not even a fleshed idea of what it does. No goals, no commitments. Just a vague interest. And by OK I mean it will work, it will have tests, it will be available to use, it will be useful and be a real thing. Think of it as a sort of documentary on the beginnings of a rock band, only instead of rockers there is a single overweight Argentinian dev, and instead of a band there is a piece of software. So, not much like a documentary on the beginnings of a rock band.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: http://ralsina.gitlab.io/boxes-book/
Learn Python, Break Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Scott Grant
- Why It’s Valuable: Learn Python, Break Python is a hands-on introduction to the Python programming language, written for people who have no experience with programming whatsoever. Hey, we all have to start somewhere. As such, the examples and teaching style used in this text make absolutely no expectations about your prior programming experience. Anyone can pick up the art of programming with a little time and a bit of patience. However, when learning something new, I try to break things. In fact, in many cases, I go out of my way to break stuff. When picking up a new concept like computer programming, you can actually increase your comfort level by figuring out the type of cases that are likely to break. You’ll see what data can be used and where, and when you inevitably run into errors later (like everyone does), you won’t be surprised.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://learnpythonbreakpython.com
Algorithmic Problem Solving with Python
- Level: Beginner
- Focus: Introductory Materials
- Author: John B. Schneider, Shira Lynn Broschat, Jess Dahmen
- Why It’s Valuable: (Not an algo book) Python’s syntax and idioms are much easier to learn than those of most other full-featured languages. This book uses programming language Python to introduce folks to programming and algorithmic thinking.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://www.eecs.wsu.edu/~schneidj/PyBook/swan.pdf
The Hitchhiker’s Guide to Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Kenneth Reitz
- Why It’s Valuable: This opinionated guide exists to provide both novice and expert Python developers a best-practice handbook to the installation, configuration, and usage of Python on a daily basis.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://buildmedia.readthedocs.org/media/pdf/python-guide/latest/python-guide.pdf
Slither Into Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Unknown
- Why It’s Valuable: Slither into Python is an introduction to Python for complete beginners. No prior programming experience or computer science background is necessary. Unlike any other Python resources I have found (not that they’re not out there), they don’t explain important computer science concepts such as memory or “how computers work”. In this book I will cover the fundamentals of the Python language and also introduce these important concepts. Put simply, coding or computer programming is about making computers do what you want, Computer Science is about how computers do it. Each go hand-in-hand, help you learn faster and improve your overall understanding of a language! This book aims to do exactly that through Python.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://www.slitherintopython.com
Python For You and Me
- Level: Beginner
- Focus: Introductory Materials
- Author: Kushal Das (Core Dev)
- Why It’s Valuable: A book for the total new comers into Python world. Was started as book for students before they read Python tutorial. Given it’s from a core dev, even up to chapter choice order is insightful.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://pymbook.readthedocs.io/en/latest/
Python for Astronomers
- Level: Beginner
- Focus: Introductory Materials
- Author: Imad Pasha, Christopher Agostino
- Why It’s Valuable: This text is designed to be an introduction to the Python programming language — which is now used nearly ubiquitously in astronomy — with applications to the types of tasks an undergraduate (or beginning graduate student) might have to tackle. It is not, in any way, meant to be comprehensive; my focus is on bringing you up to speed as efficiently and quickly as possible. This text might have useful information for those with a working knowledge of Python outside of a research setting, but is primarily designed for those with no prior programming experience. By the end of this text, I hope to have shared enough to make you feel comfortable taking the first steps into research-type problems (of which this book will contain several examples), whether in an astronomy course, a research internship, or on-campus research.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://prappleizer.github.io/textbook.pdf
OBI Intermediate Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Obi Ike-Nwosu
- Why It’s Valuable: The python ecosystem is awash with books for beginners but few books target readers that are past the beginning stages but are not yet advanced users. The book aims to bridge that gap. The content of this book looks primarily at the various means for code organization in Python and provides user with a rigorous grounding in these. it dives into topics such as python object system, functions, decorators, metaprogramming and generators providing the reader with an in-depth knowledge of these topics that is essential for writing idiomatic and robust python code. It aims to provide a reader with not only a how-to but also a why for Python concepts. Concepts are well explained with abundance of code snippets. If you are looking for a book to take you beyond the beginner level in python, this is definitely the right book for you.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://leanpub.com/intermediatepython
A Python Book: Beginning Python, Advanced Python, and Python Exercises
- Level: Beginner
- Focus: Introductory Materials
- Author: Dave Kuhlman
- Why It’s Valuable: This document is a self-learning document for a course in Python programming. This course contains (1) a part for beginners, (2) a discussion of several advanced topics that are of interest to Python programmers, and (3) a Python workbook with lots of exercises. This book is a collection of materials that I’ve used when conducting Python training and also materials from my Web site that are intended for self-instruction.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: http://www.davekuhlman.org/python_book_01.pdf
DigitalOcean eBook: How To Code in Python
- Level: Beginner
- Focus: Introductory Materials
- Author: Lisa Tagliaferri
- Why It’s Valuable: If you use the book in the order it is laid out, you’ll begin your exploration in Python by understanding the key differences between Python 3 and the previous versions of the language. From there, you’ll set up a programming environment for your relevant local or server-based system, and begin by learning general Python code structure, syntax, and data types. Along the way, you’ll gain a solid grounding in computational logic within Python, a set of skills relevant even when moving to other programming languages in the future. While the beginning of the book focuses on scripting in Python, object-oriented coding concepts are gradually introduced to help make your code more modular, flexible, and complex without repetition. By the end of the book, you’ll learn how to debug your Python code and finally how to port Python code across versions.
- Who Should Read It? Beginners interested in introductory materials.
- Official Access Link: https://assets.digitalocean.com/books/python/how-to-code-in-python.pdf
CONTINUATION
Beyond the Basic Stuff with Python
- Level: Intermediate
- Focus: Continuation
- Author: Al Sweigart
- Why It’s Valuable: More than a mere collection of advanced syntax and masterful tips for writing clean code, you’ll learn how to advance your Python programming skills by using the command line and other professional tools like code formatters, type checkers, linters, and version control. Sweigart takes you through best practices for setting up your development environment, naming variables, and improving readability, then tackles documentation, organization and performance measurement, as well as object-oriented design and the Big-O algorithm analysis commonly used in coding interviews. The skills you learn will boost your ability to program—not just in Python but in any language.
- Who Should Read It? Intermediate developers interested in continuation.
- Official Access Link: http://www.davekuhlman.org/python_201.html
Python 201 – (Slightly) Advanced Python Topics
- Level: Intermediate
- Focus: Continuation
- Author: Dave Kuhlman
- Why It’s Valuable: It shines with creating a parser with Plex.
- Who Should Read It? Intermediate developers interested in continuation.
- Official Access Link: http://www.davekuhlman.org/python_201.html
Python re(gex)?
- Level: Intermediate
- Focus: Continuation
- Author: Sundeep Agarwal
- Why It’s Valuable: An entire book, dedicated to RegEx.
- Who Should Read It? Intermediate developers interested in continuation.
- Official Access Link: https://learnbyexample.github.io/py_regular_expressions/
PROJECTS-BASED
Automate the Boring Stuff with Python
- Level: Varies
- Focus: Projects-Based
- Author: Al Sweigart - No Starch Press
- Why It’s Valuable: If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do them for you? In Automate the Boring Stuff with Python, you’ll learn how to use Python to write programs that do in minutes what would take you hours to do by hand-no prior programming experience required. Once you’ve mastered the basics of programming, you’ll create Python programs that effortlessly perform useful and impressive feats of automation.Don’t spend your time doing work a well-trained monkey could do. Even if you’ve never written a line of code, you can make your computer do the grunt work. Learn how in Automate the Boring Stuff with Python. A true example of legally free Python books.
- Who Should Read It? Experienced developers interested in projects-based.
- Official Access Link: https://automatetheboringstuff.com
The Recursive Book Of Recursion
- Level: Varies
- Focus: Projects-Based
- Author: Al Sweigart - No Starch Press
- Why It’s Valuable: This book teaches the basics of recursion, exposes the ways it’s often poorly taught, and clarifies the fundamental principles behind all recursive algorithms. It is project-based, containing complete, runnable programs in both Python and JavaScript, and covers several common recursive algorithms for tasks like calculating factorials, producing numbers in the Fibonacci sequence, tree traversal, maze solving, binary search, quicksort and merge sort, Karatsuba multiplication, permutations and combinations, and solving the eight queens problem.
- Who Should Read It? Experienced developers interested in projects-based.
- Official Access Link: https://inventwithpython.com/recursion/
The Big Book of Small Python Projects
- Level: Varies
- Focus: Projects-Based
- Author: Al Sweigart - No Starch Press
- Why It’s Valuable: This curated collection of simple Python projects lets you dive right in and make digital art, games, animations, number-crunching tools and more – right away! Forget standard step-by-step tutorials; instead, author Al Sweigart takes a learn-by-doing approach that provides you with over 80 programs to manually copy, run, and play with. Once you see how the code works, it’s time to experiment with your own changes and practice re-creating them yourself.
- Who Should Read It? Experienced developers interested in projects-based.
- Official Access Link: https://inventwithpython.com/bigbookpython/
Python for Scientists and Engineers
- Level: Varies
- Focus: Projects-Based
- Author: Shantnu Tiwari
- Why It’s Valuable: Video processing DSP, machine learning and Rpi, this book is the next book Python beginners should maybe jump to to consolidate their knowledge.
- Who Should Read It? Experienced developers interested in projects-based.
- Official Access Link: https://www.pythonforengineers.com/python-for-scientists-and-engineers/
Python For Fun
- Level: Varies
- Focus: Projects-Based
- Author: Chris Meyers
- Why It’s Valuable: Python for Fun turns 16 this year. From the first project “Lisp in Python” to the current latest “Binary Trees and Functional Programming”, the site is and remains a collection of fairly small projects created mostly for fun. They are aimed at the intermediate programmer; people who know Python and are fairly comfortable with OOP and perhaps a bit of basic recursion. Most programs are quite short, generally a few pages of code and all of the projects are accompanied with a write-up.
- Who Should Read It? Experienced developers interested in projects-based.
- Official Access Link: http://www.openbookproject.net/py4fun/
Tiny Python Projects
- Level: Varies
- Focus: Projects-Based
- Author: Ken Youens-Clark
- Why It’s Valuable:
Tiny Python Projects is a progression of coding challenges designed to take you from novice to Pythonista. There are 22 programs for you to write that include tests so you know when you have solved the problems correctly. So really you’ll be learning Python and how to test programs. We’ll also talk about how to parameterize our programs so that they are flexible and documented. Contributed by
u/liam_darach - Who Should Read It? Experienced developers interested in projects-based.
- Official Access Link: https://tinypythonprojects.com/#/
CORRECT WAY
Practices of the Python Pro
- Level: Varies
- Focus: Correct Way
- Author: Dane Hillard
- Why It’s Valuable: Introductory book to good software engineering practices like separation of concerns, high performance and loose coupling. A must for every beginner!
- Who Should Read It? Experienced developers interested in correct way.
- Official Access Link: https://livebook.manning.com/book/code-like-a-pro/about-this-book/
INTERNALS
Inside The Python Virtual Machine
- Level: Advanced
- Focus: Internals
- Author: Obi Ike-Nwosu
- Why It’s Valuable: fasten your seat-belts as this book will take you on a tour of the virtual machine that runs your Python code. It will describe how Python code is compiled and run, how the language itself can be modified and will demystify the mysterious bytecodes that run on the Python virtual machine.
- Who Should Read It? Experienced developers interested in internals.
- Official Access Link: https://leanpub.com/insidethepythonvirtualmachine
SOFTWARE ENGINEERING
Clean Architectures in Python
- Level: Advanced
- Focus: Software Engineering
- Author: Leonardo Giordani - LeanPub. Also available on pycabook.com
- Why It’s Valuable: What is a good software architecture? Why should we bother structuring the code and spending time testing it? If you like spending hours debugging your programs or staying late at the office to recover from a buggy deploy in production this book is definitely NOT for you!
- Who Should Read It? Experienced developers interested in software engineering.
- Official Access Link: https://leanpub.com/clean-architectures-in-python
The Little Book of Python Anti-Patterns
- Level: Advanced
- Focus: Software Engineering
- Author: QuantifiedCode
- Why It’s Valuable: Welcome, fellow Pythoneer! This is a small book of Python anti-patterns and worst practices. Learning about these anti-patterns will help you to avoid them in your own code and make you a better programmer (hopefully). Each pattern comes with a small description, examples and possible solutions. A true example of legally free python books.
- Who Should Read It? Experienced developers interested in software engineering.
- Official Access Link: https://docs.quantifiedcode.com/python-anti-patterns/
Python 3 Patterns, Recipes and Idioms
- Level: Advanced
- Focus: Software Engineering
- Author: Bruce Eckel
- Why It’s Valuable: Python 3 concepts, patterns and idioms. Addressed to the experienced Python programmer (not beginner)
- Who Should Read It? Experienced developers interested in software engineering.
- Official Access Link: https://python-3-patterns-idioms-test.readthedocs.io/en/latest/
Design Patterns in Python
- Level: Advanced
- Focus: Software Engineering
- Author: Alexander Shvets, Andrei Boyanov
- Why It’s Valuable: Design patterns in Python divided in chapters with example, free on the link. Is an Apress book. Super cool book!
- Who Should Read It? Experienced developers interested in software engineering.
- Official Access Link: https://refactoring.guru/design-patterns/python
Python Design Patterns
- Level: Advanced
- Focus: Software Engineering
- Author: Brandon Rhodes
- Why It’s Valuable: A classic and respected book on DP in the Python community.
- Who Should Read It? Experienced developers interested in software engineering.
- Official Access Link: https://python-patterns.guide
Cosmic Python
- Level: Advanced
- Focus: Software Engineering
- Author: Harry Percival, Bob Gregory
- Why It’s Valuable: Our aim with this book is to introduce several classic architectural patterns and show how they support TDD, DDD, and event-driven services. We hope it will serve as a reference for implementing them in a Pythonic way, and that people can use it as a first step toward further research in this field.
- Who Should Read It? Experienced developers interested in software engineering.
- Official Access Link: https://www.cosmicpython.com
TDD
Test-Driven Web Development with Python
- Level: Advanced
- Focus: Tdd
- Author: Harry Percival
- Why It’s Valuable: “Test-Driven Web Development with Python” aims to teach TDD for web programming. It uses a concrete example – the development of a website, from scratch – to explain the TDD metholology and how it applies to building web applications. It covers the Selenium browser-automation tool, unit testing, mocking, and interacting with Web technologies from the basics of static content, database integration, throught the inescapable JavaScript, and onto more advanced (and trendy) topics like NoSQL, websockets and Async programming. A true example of legally free Python books.
- Who Should Read It? Experienced developers interested in tdd.
- Official Access Link: https://www.obeythetestinggoat.com/pages/book.html
OOP
Building Skills in Object-Oriented Design
- Level: Advanced
- Focus: Oop
- Author: Steve F. Lot
- Why It’s Valuable: How do you move from OO programming to OO design? This 301-page book has 49 chapters that will help you build OO design skills through the creation of a moderately complex family of application programs.
- Who Should Read It? Experienced developers interested in oop.
- Official Access Link: https://slott56.github.io/building-skills-oo-design-book/build/html/index.html#
Object Oriented Programming with Python
- Level: Advanced
- Focus: Oop
- Author: Ashwin Pajankar, Sushant Garg - LeanPub
- Why It’s Valuable: This book is the simple and definitive guide to the Python 3 Object Oriented Programming. Other book of the similar genres make use of complicated writing style and examples to introduce the readers to the OOP in Python 3. However, this book uses Simple language to explain concepts. It is aimed at intermediate learners who already know Python.
- Who Should Read It? Experienced developers interested in oop.
- Official Access Link: https://leanpub.com/PythonOOP
FUNCTIONAL PROGRAMMING
Functional Programming in Python
- Level: Advanced
- Focus: Functional Programming
- Author: David Mertz
- Why It’s Valuable: Python is not a functional programming language, but it is a multi-paradigm language that makes functional programming easy to perform, and easy to mix with other programming styles. In this paper, David Mertz, a director of Python Software Foundation, examines the functional aspects of the language and points out which options work well and which ones you should generally decline.
- Who Should Read It? Experienced developers interested in functional programming.
- Official Access Link: https://www.oreilly.com/programming/free/files/functional-programming-python.pdf
TEXT PROCESSING
Text Processing in Python
- Level: Varies
- Focus: Text Processing
- Author: David Mertz
- Why It’s Valuable: This is an example-driven, hands on tutorial that carefully teaches programmers how to accomplish numerous text processing tasks using Python.
- Who Should Read It? Experienced developers interested in text processing.
- Official Access Link: http://gnosis.cx/TPiP/
CRYPTOGRAPHY
Cracking Codes with Python
- Level: Advanced
- Focus: Cryptography
- Author: Al Sweigart - No Starch Press
- Why It’s Valuable: Cracking Codes with Python teaches complete beginners how to program in the Python programming language. The book features the source code to several ciphers and hacking programs for these ciphers. The programs include the Caesar cipher, transposition cipher, simple substitution cipher, multiplicative & affine ciphers, Vigenere cipher, and hacking programs for each of these ciphers. The final chapters cover the modern RSA cipher and public key cryptography.
- Who Should Read It? Experienced developers interested in cryptography.
- Official Access Link: https://inventwithpython.com/cracking/
WEB
Explore Flask
- Level: Varies
- Focus: Web
- Author: Robert Picard
- Why It’s Valuable: This book is a collection of the best practices for using Flask. There are a lot of pieces to the average Flask application. You’ll often need to interact with a database and authenticate users, for example. In the coming pages I’ll do my best to explain the “right way” to do this sort of stuff. My recommendations aren’t always going to apply, but I’m hoping that they’ll be a good option most of the time. It might be the Flask book you need! A true example of legally free Python books.
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: http://exploreflask.com/en/latest/preface.html
Django Girls Intro
- Level: Varies
- Focus: Web
- Author: Unknown
- Why It’s Valuable: A simple, step by step straight-forward introduction to Django designed to be hands-on and so breaks it down for your to really understand. Tested with Python 3.8, Django 3.0, still works. An amazing first material for beginners. It even assumes you don’t know Python at all!
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: https://tutorial.djangogirls.org/en/
Django Girls Beyond The Basics
- Level: Varies
- Focus: Web
- Author: Unknown
- Why It’s Valuable: This tutorial picks up where the previous tutorial left. It includes draft, delete and commenting systems. A graceful roundup.
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: https://tutorial-extensions.djangogirls.org/en/
Django RESTful Web Services
- Level: Varies
- Focus: Web
- Author: Gaston C. Hillar - Packt
- Why It’s Valuable: Django is a Python web framework that makes the web development process very easy. It reduces the amount of trivial code that simplifies the creation of web applications and results in faster development. It is a very powerful and a great choice for creating RESTful web services. Includes API auth, pagination and test automation.
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: https://www.packtpub.com/free-ebooks/django-restful-web-services
Build websites with Web2Py
- Level: Varies
- Focus: Web
- Author: Massimo Di Pierro
- Why It’s Valuable:
I believe that the ability to easily build high quality web applications is of critical importance for the growth of a free and open society. This prevents the biggest players from monopolizing the flow of information. As you will learn in the following pages,
web2pytries to lower the barrier of entry to web development by focusing on three main goals: ease of use, rapid development and security. - Who Should Read It? Experienced developers interested in web.
- Official Access Link: http://web2py.com/book
The Flask Mega-Tutorial
- Level: Varies
- Focus: Web
- Author: Miguel Grinberg
- Why It’s Valuable: Introduction to web development with Flask. A Flask classic!
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world
Web App with Redis And Streaming
- Level: Varies
- Focus: Web
- Author: Allen Downey
- Why It’s Valuable: Same as Think Data Structures
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: http://greenteapress.com/thinkdast/thinkdast.pdf
Create a Simple Flask Application with Cloud9, Heroku and MongoDB
- Level: Varies
- Focus: Web
- Author: Douglas Starnes
- Why It’s Valuable: One of the biggest hurdles to learning a new framework, language or tool is the prerequisite setup and configuration that needs to take place. This can be a frustrating and discouraging experience. Also, the cost associated with doing often makes experimentation prohibitive or at least restricted. That is why in this short book, I have chosen tools and services that require little or no setup, and are all free. In fact, none of them require any installation because they all run in the browser. Throughout the enitire book, you’ll never have to leave the web browser.
- Who Should Read It? Experienced developers interested in web.
- Official Access Link: https://leanpub.com/flask-cloud9-heroku-mongodb-ebook
GAMES
Invent Your Own Computer Games with Python
- Level: Varies
- Focus: Games
- Author: Al Sweigart - No Starch Press
- Why It’s Valuable: Invent Your Own Computer Games with Python teaches you how to program in the Python language. Each chapter gives you the complete source code for a new game, and then teaches the programming concepts from the examples. Games include Guess the Number, Hangman, Tic Tac Toe, and Reversi. This book also has an introduction to making games with 2D graphics using the Pygame framework. A true example of legally free Python books.
- Who Should Read It? Experienced developers interested in games.
- Official Access Link: https://inventwithpython.com/invent4thed/
Make Games with Graphics
- Level: Varies
- Focus: Games
- Author: Al Sweigart - No Starch Press
- Why It’s Valuable: Making Games with Python & Pygame covers the Pygame library with the source code for 11 games. Making Games was written as a sequel for the same age range as Invent with Python. Once you have an understanding of the basics of Python programming, you can now expand your abilities using the Pygame library to make games with graphics, animation, and sound.
- Who Should Read It? Experienced developers interested in games.
- Official Access Link: http://inventwithpython.com/pygame/
Make Games With Python
- Level: Varies
- Focus: Games
- Author: Sean M. Tracey - The mag Pi
- Why It’s Valuable: Python basics, sounds, physics and alien game, A simple mix.
- Who Should Read It? Experienced developers interested in games.
- Official Access Link: https://www.raspberrypi.org/magpi-issues/Essentials_Games_v1.pdf
Program Arcade Games With Python And Pygame
- Level: Varies
- Focus: Games
- Author: Paul Vincent Craven
- Why It’s Valuable: A cheerful guide to Python. Gleeful content. Demos of what students created make you feel part of a cool class.
- Who Should Read It? Experienced developers interested in games.
- Official Access Link: http://programarcadegames.com
Becoming PyGamer
- Level: Varies
- Focus: Games
- Author: Jani Tiainen
- Why It’s Valuable: Your PyGame introductory book. Perfect for PyGame workshops!
- Who Should Read It? Experienced developers interested in games.
- Official Access Link: https://becomingpygamer.book.tiainen.cc/en/latest/
DATA STRUCTURES AND ALGORITHMS
Open Data Structures
- Level: Varies
- Focus: Data Structures And Algorithms
- Author: Pat Morin
- Why It’s Valuable: There are plenty of books that teach introductory data structures. Some of them are very good. Most of them cost money. The goal of this project is to free undergraduate computer science students from having to pay for an introductory data structures book.
- Who Should Read It? Experienced developers interested in data structures and algorithms.
- Official Access Link: https://www.aupress.ca/app/uploads/120226_99Z_Morin_2013-Open_Data_Structures.pdf
Problem Solving with Algorithms and Data Structures using Python
- Level: Varies
- Focus: Data Structures And Algorithms
- Author: Brad Miller and David Ranum
- Why It’s Valuable: Probably the best data and algo book out there. It goes in depth about data structures and algorithms. It covers basic Python which makes it a suitable introductory material for undergrad university students. Beginning from stacks, the coverage goes in details and solves common problems such as the Hanoi tower.
- Who Should Read It? Experienced developers interested in data structures and algorithms.
- Official Access Link: https://runestone.academy/runestone/books/published/pythonds/index.html
Think Complexity
- Level: Varies
- Focus: Data Structures And Algorithms
- Author: Allen Downey
- Why It’s Valuable: Complexity Science is an interdisciplinary field that focuses on discrete models of physical and social systems.
- Who Should Read It? Experienced developers interested in data structures and algorithms.
- Official Access Link: http://greenteapress.com/complexity2/thinkcomplexity2.pdf
Think Data Structures
- Level: Varies
- Focus: Data Structures And Algorithms
- Author: Allen Downey
- Why It’s Valuable: Data structures and algorithms are among the most important inventions of the last 50 years. This book organizes the topics around an application—web search—that uses data structures extensively.
- Who Should Read It? Experienced developers interested in data structures and algorithms.
- Official Access Link: http://greenteapress.com/thinkdast/thinkdast.pdf
Annotated Algorithms (including numerical) in Python With Applications in Physics, Biology And Finance
- Level: Varies
- Focus: Data Structures And Algorithms
- Author: Massimo Di Pierro
- Why It’s Valuable: This book is assembled from lectures given by the author over a period of 10 years at the School of Computing of DePaul University.
- Who Should Read It? Experienced developers interested in data structures and algorithms.
- Official Access Link: https://raw.githubusercontent.com/mdipierro/nlib/master/docs/book_numerical.pdf
COMPUTER VISION
Programming Computer Vision with Python
- Level: Varies
- Focus: Computer Vision
- Author: Jan Erik Solem - O’Reilly
- Why It’s Valuable: Cameras are everywhere. Computer vision powers applications like image search, robot navigation, medical image analysis, photo management and many more.
- Who Should Read It? Experienced developers interested in computer vision.
- Official Access Link: http://programmingcomputervision.com/downloads/ProgrammingComputerVision_CCdraft.pdf
DATA SCIENCE
Geographic Thinking for Data Scientists
- Level: Varies
- Focus: Data Science
- Author: Sergio Rey
- Why It’s Valuable: This book provides the tools, the methods, and the theory to meet the challenges of contemporary data science applied to geographic problems and data.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: https://geographicdata.science/book/intro.html
An Introduction to Statistical Learning
- Level: Varies
- Focus: Data Science
- Author: Gareth James, Daniela Witten, Trevor Hastie,Rob Tibshirani, Jonathan Taylor
- Why It’s Valuable:
An Introduction to Statistical Learning provides a broad and less technical treatment of key topics in statistical learning. Contributed by
u/Difference_Klutzy - Who Should Read It? Experienced developers interested in data science.
- Official Access Link: https://www.statlearning.com/
Python for Data Analysis
- Level: Varies
- Focus: Data Science
- Author: Wes McKinney
- Why It’s Valuable: This book is concerned with the nuts and bolts of manipulating, processing, cleaning, and crunching data in Python.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: https://wesmckinney.com/book/
Elements of Data Science
- Level: Varies
- Focus: Data Science
- Author: Allen Downey
- Why It’s Valuable: Elements of Data Science is an introduction to data science for people with no programming experience.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: https://allendowney.github.io/ElementsOfDataScience/index.html
Effective Pandas
- Level: Varies
- Focus: Data Science
- Author: Tom Augspurger
- Why It’s Valuable: This series is about how to make effective use of pandas, a data analysis library for the Python programming language.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: https://leanpub.com/effective-pandas
Think Stats
- Level: Varies
- Focus: Data Science
- Author: Allen Downey
- Why It’s Valuable: Think Stats is an introduction to Probability and Statistics for Python programmers.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: http://greenteapress.com/thinkstats2/thinkstats2.pdf
Probabilistic Programming & Bayesian Methods for Hackers
- Level: Varies
- Focus: Data Science
- Author: Cam Davidson-Pilon
- Why It’s Valuable: The Bayesian method is the natural approach to inference. Bayesian Methods for Hackers is designed as a introduction to Bayesian inference from a computational/understanding-first, and mathematics-second, point of view.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
Think Bayes
- Level: Varies
- Focus: Data Science
- Author: Allen Downey
- Why It’s Valuable: Think Bayes is an introduction to Bayesian statistics using computational methods.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: http://www.greenteapress.com/thinkbayes/thinkbayes.pdf
Digital Signal Processing in Python (Think DSP)
- Level: Varies
- Focus: Data Science
- Author: Allen Downey
- Why It’s Valuable: Think DSP is an introduction to Digital Signal Processing in Python.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: http://greenteapress.com/thinkdsp/thinkdsp.pdf
A Programmer’s Guide to Data Mining
- Level: Varies
- Focus: Data Science
- Author: Ron Zacharski
- Why It’s Valuable: Highly recommended book that takes your hand and explains the maths side of data with lots of illustrations.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: http://guidetodatamining.com/assets/guideChapters/Guide2DataMining.pdf
Python Data Science Handbook
- Level: Varies
- Focus: Data Science
- Author: Jake VanderPlas
- Why It’s Valuable: This is a book about doing data science with Python. It is meant to help Python users learn to use Python’s data science stack–libraries such as IPython, NumPy, Pandas, Matplotlib, Scikit-Learn, and related tools.
- Who Should Read It? Experienced developers interested in data science.
- Official Access Link: https://jakevdp.github.io/PythonDataScienceHandbook/
VISUALISATIONS-FOCUSED
Python & OpenGL for Scientific Visualization
- Level: Varies
- Focus: Visualisations-Focused
- Author: Nicolas Rougier
- Why It’s Valuable: This book reconciles Python programmers with OpenGL, providing both an introduction to modern OpenGL and a set of basic and advanced techniques.
- Who Should Read It? Experienced developers interested in visualisations-focused.
- Official Access Link: https://www.labri.fr/perso/nrougier/python-opengl/
DISTRIBUTED SYSTEMS
Hadoop With Python
- Level: Advanced
- Focus: Distributed Systems
- Author: Zachary Radtka, Donald Miner - Oreilly
- Why It’s Valuable: About hadoop with Python. Map reduce and PySpark included.
- Who Should Read It? Experienced developers interested in distributed systems.
- Official Access Link: https://www.oreilly.com/programming/free/files/hadoop-with-python.pdf
MACHINE LEARNING & DEEP LEARNING
Python Machine Learning By Example
- Level: Advanced
- Focus: Machine Learning & Deep Learning
- Author: Yuxi (Hayden) Liu - Packt
- Why It’s Valuable: This book is your entry point to machine learning. Includes spam detection and stock price prediction.
- Who Should Read It? Experienced developers interested in machine learning & deep learning.
- Official Access Link: https://www.packtpub.com/free-ebooks/python-machine-learning-example
Neural Networks and Deep Learning
- Level: Advanced
- Focus: Machine Learning & Deep Learning
- Author: Michael Nielsen
- Why It’s Valuable: The book will teach you about Neural networks and Deep learning.
- Who Should Read It? Experienced developers interested in machine learning & deep learning.
- Official Access Link: http://neuralnetworksanddeeplearning.com/index.html
Deep Learning with Python
- Level: Advanced
- Focus: Machine Learning & Deep Learning
- Author: Francois Chollet
- Why It’s Valuable: This book offers a practical, hands-on exploration of deep learning. It avoids mathematical notation, preferring instead to explain quantitative concepts via code snippets.
- Who Should Read It? Experienced developers interested in machine learning & deep learning.
- Official Access Link: https://livebook.manning.com/book/deep-learning-with-python/table-of-contents/
NATURAL LANGUAGE PROCESSING
Hands-On Natural Language Processing with Python
- Level: Varies
- Focus: Natural Language Processing
- Author: Rajesh Arumugam and Rajalingappaa Shanmugamani - Packt
- Why It’s Valuable: This book teaches you to leverage deep learning models in performing various NLP tasks.
- Who Should Read It? Experienced developers interested in natural language processing.
- Official Access Link: https://www.packtpub.com/free-ebooks/hands-natural-language-processing-python
Natural Language Processing with Python
- Level: Varies
- Focus: Natural Language Processing
- Author: Steven Bird, Ewan Klein, Edward Loper
- Why It’s Valuable: This is a book about Natural Language Processing.
- Who Should Read It? Experienced developers interested in natural language processing.
- Official Access Link: http://www.nltk.org/book/
PORTING TO PYTHON3
Supporting Python3
- Level: Varies
- Focus: Porting To Python3
- Author: Lennart Regebro
- Why It’s Valuable: This book guides you through the process of porting your Python 2 code to Python 3.
- Who Should Read It? Experienced developers interested in porting to python3.
- Official Access Link: http://python3porting.com/pdfs/SupportingPython3-screen-1.0-latest.pdf
MISCELLANEOUS
Python in Hydrology
- Level: Varies
- Focus: Miscellaneous
- Author: Sat Kumar Tomer
- Why It’s Valuable: This book teaches you how to compute rainfall, precipitation, evaporation, River Routing–Muskingum method and a host of things in Hydrology.
- Who Should Read It? Experienced developers interested in miscellaneous.
- Official Access Link: http://www.greenteapress.com/pythonhydro/pythonhydro.pdf
Bioinformatics in Python
- Level: Varies
- Focus: Miscellaneous
- Author: Jeff Chang, Brad Chapman, Iddo Friedberg, Thomas Hamelryck, Michiel de Hoon, Peter Cock, Tiago Antao, Eric Talevich, Bartek Wilczy´nski
- Why It’s Valuable: A BioPython tutorial and cookbook which teaches computational molecular biology using free Python tools.
- Who Should Read It? Experienced developers interested in miscellaneous.
- Official Access Link: http://biopython.org/DIST/docs/tutorial/Tutorial.pdf
Modeling and Simulation in Python
- Level: Varies
- Focus: Miscellaneous
- Author: Allen Downey
- Why It’s Valuable: Modeling and Simulation in Python is an introduction to physical modeling using a computational approach.
- Who Should Read It? Experienced developers interested in miscellaneous.
- Official Access Link: http://greenteapress.com/modsimpy/ModSimPy3.pdf
Modelling Creativity
- Level: Varies
- Focus: Miscellaneous
- Author: Tom D. De Smedt
- Why It’s Valuable: A blend of generative art, machine learning, NLP, algorithms and sentiment analysis.
- Who Should Read It? Experienced developers interested in miscellaneous.
- Official Access Link: https://www.clips.uantwerpen.be/sites/default/files/modeling-creativity.pdf
Introduction to Scientific Computing in Python
- Level: Varies
- Focus: Miscellaneous
- Author: Robert Johansson
- Why It’s Valuable: Introduction to Scientific Computing in Python.
- Who Should Read It? Experienced developers interested in miscellaneous.
- Official Access Link: http://raw.github.com/jrjohansson/scientific-python-lectures/master/Scientific-Computing-with-Python.pdf
Frequently Asked Questions (FAQ)
Are these books really free and legal?
Yes. Every book in this list is either released under a Creative Commons license, made free by the author on their website, or offered as a legal “free tier” by publishers like No Starch Press or Manning.
Which book should I start with as a complete beginner?
We recommend Think Python for a computer science approach, or Automate the Boring Stuff if you want to see immediate practical results in your daily work.
Do I need to know math to learn Python?
Most Python tasks (web dev, automation, scripting) require only basic logic. Specialized fields like Machine Learning or Data Science do require a grasp of statistics and linear algebra, but many of the books listed here (like Think Bayes) teach the math through code.
Is Python 2 still relevant?
No. All resources in this list focus on Python 3. Python 2 reached its end-of-life in 2020 and should no longer be used for new projects or learning.
Found a broken link? Please contact arj.python at gmail dot com to help keep this resource updated for the community.
Written by
Abdur-Rahmaan Janhangeer
Chef
Python author of 7+ years having worked for Python companies around the world
Suggested Posts
Free Python Courses List
Here is a list of Python free courses that i maintain An Introduction to Interactive Programming in ...
Python Engineering Articles
This page lists the very best Python engineering articles of the internet, hand-picked to give hours...
What's New in Python 3.9 alpha2?
Python is set to release a new version next year, the shiny 3.9. This one omitted the sys.argv chang...