Introduction
- The 6 Best Python Courses on the Internet in 2023 • LearnDataSci 📖
- Introduction to the Python 3 Programming Language • Egghead 🎓
- The Python Tutorial • Python docs 📚
- Learn Python by Building Five Games • freeCodeCamp 📺
- Python Programming MOOC 2023 • Learn the basics of programming with the Python programming language. The focus of the course is on programming, and you will learn how to write programs and understand how they work. For example, the basics of algorithms, control structures, subprograms, object-oriented programming are covered. The course is suitable to anyone who wants to learn programming. No prior programming experience is required. • University of Helsinki 👩🎓
- Invent with Python • Al Sweigart 📕
- Automate the Boring Stuff with Python • Al Sweigart 📕
- CS50’s Introduction to Programming with Python • Harvard University 👩🎓
- futurecoder: learn python from scratch • 100% free and interactive Python course for beginners • Alex Hall 👩🎓
- Python on Exercism • Get fluent in Python by solving 137 exercises • Exercism 👩🎓
- A complete Beginner’s Guide to Python by Making Simple Games • Al Sweigart 📺
- Learn Python in Y Minutes • Learn X in Y Minutes 📖
General
- dabeaz-course/python-mastery • Advanced Python mastery course
- Python and Pandas code snippets • InterviewQs 📖
- 5 Good Python Habits • check for
'__main__'
, give each module amain()
function, use list comprehensions • Indently 📺 - 5 Uncommon Python Features I Love • slice objects, set operations,
__format__
class method, walrus operator (:=
), currying • Indently 📺 - Python Cheatsheet • Wilfred Inni 📕
- Python Cheat Sheet & Quick Reference • QuickRef 📖
- Python Docs 📚
- Python • Nice shortlist of useful modules and language features • Jesse Squires 📖
- Python Terminology: an unofficial glossary • Python Morsels 📖
macOS setup
- Rye - Pyenv and Pip alternative from the creators of Ruff
- Try this as an alternative to the steps below?
- Install
pyenv
brew install pyenv
+brew install pyenv-virtualenv
- confirm what I added in the end
- Install Python using
pyenv
- do not
brew install python
orbrew install python3
- confirm if it’s installed
- do not
- Set up VS Code
- Add Python extension to VS Code
- hopefully this doesn’t happen to you, but it did to me: if trouble with the Python extension (Python not added to the file language options list, python commands not working in integrated terminal):
- completely uninstall VS code (via AppCleaner + Homebrew uninstall +
rm -rf ~/.vscode
) - start a new VS install (via Homebrew) from scratch
- carefully add one extension and setting at a time + settings sync as you go after each change
- completely uninstall VS code (via AppCleaner + Homebrew uninstall +
Pyenv
- Version management for Python projects, similar to NVM for Node.js
- Managing Multiple Python Versions With pyenv • Real Python 📖
Functions
Positional vs Keyword Arguments
- The advantage of using keyword arguments is that the caller of the function can specify them in any order.
- The advantage of using positional arguments is that the caller of the function doesn’t need to know the names of the arguments.
- In general, it’s best to use keyword arguments for optional arguments and positional arguments for required arguments.
- Keyword (Named) Arguments in Python: How to Use Them • Trey Hunner 📖
- Positional vs Keyword Arguments in Python • GeeksforGeeks 📖
- Star (*) as a parameter in python function • Stack Overflow 📖
- python - How can we force naming of parameters when calling a function? • Stack Overflow 📖
- positional / named only without
*
or/
? (intermediate) anthony explains • Anthony Sottile 📺
Closures
- A Pro Programmer Move (Closure in Python) • How to use a closure in Python to read and update a value • Pythonic Magic and Skill 📺
Decorators
- A beautiful Python monstrosity • An interesting refactoring journey in which abusing decorators resulted in much more readable code • Trey Hunner 📖
Classes
- class vs dataclass vs ABC vs Protocol?
- Why I prefer attrs over dataclasses • mCoding 📺
Loops
- Quirky Python Loop Thing • Something interesting with Python array looping…
Performance
- Boost Python Code Performance with Caching: Exploring Techniques and Tools • How to dramatically speed up reruns of slow functions with
@functools.cache
and slow network requests withrequest_cache
• Pybites 📺
Types
- Writing Python like it’s Rust • Jakub Beránek 📖
Other Syntax
if __name__ = ‘__main__’
- means “if this app was run directly via a command like
python file.py
”
- means “if this app was run directly via a command like
- Test if all elements of a python list are False • StackOverflow 👩💻
- Write a Python decorator from scratch to time the execution of a function • Pybites 📺
- Multiple assignment and tuple unpacking improve Python code readability • Trey Hunner 📖
Testing
- Pytest:
- Pytest — a beginner’s guide • Lalitha 📖
- Pytest: Guide to Writing Effective Tests • Nadir Riyani 📖
- How do I print to console in pytest? • Stack Overflow 👩💻
- unittest.mock:
- unittest.mock — mock object library • Python docs 📚
- The many flavors of mock.patch • Trey Hunner 📖
NumPy
- Complete Python NumPy Tutorial (Creating Arrays, Indexing, Math, Statistics, Reshaping) • Keith Galli 📺
Flask
- Quickstart • Flask docs 📚
- Tutorial • Flask docs 📚
- How To Build & Deploy a React + Flask App | Towards Data Science • Reine 📖
- Learn Flask for Python — Full Tutorial • freeCodeCamp.org 📺
- Full Stack Flask, React, and Postgres, pt. 1 • Chris DeSilva 📺
Web Scraping
- Python Web Scraping with Beautiful Soup: Extracting Book Data • Quick walkthrough of how to use
BeautifulSoup
to parse a list of items on a webpage • Pybites 📺 - Scrape Twitter with 5 Lines of Code • Using
snscrape
to scrape social network data • Rob Mulla 📺
CSV Parsing
- Csv Parsing - From List to Dict to (SimpleNamespace) Object • Pybites 📺
- Using a bit of Python to get random emails from a csv file • Pybites 📺
SQLAlchemy
- Inbox:
- SQLAlchemy & Copilot Pt 1 - Defining Models • Visual Studio Code 📺
- SQLAlchemy & Copilot Pt 2 - SQLite Databases • Visual Studio Code 📺
- SQLAlchemy & Copilot Pt 3 - Running Queries • Visual Studio Code 📺
Logging
- Modern Python logging • mCoding 📺
Error Handling
- Useful Trick For Clean Python Code • If you handle them the same way, you can catch multiple error types in the same line • Indently 📺
Inbox
- Complete Python Mastery • Programming with Mosh 👨🎓
- python: python - Most pythonic way of assigning keyword arguments using a variable as keyword? - Stack Overflow - store kwargs to a function that takes keyword arguments as a dict, then unpack with function(**kwargs)
- python: ruff: Goodbye to Flake8 and PyLint: faster linting with Ruff
- python: ruff: Ruff: one Python linter to rule them all
- python: pytest: API Reference — pytest documentation - command line flag reference
- python: ruff: Ruff - linter and formatter that replaces Flake8, isort and Black
- pandas: intro: Getting started — pandas 2.1.3 documentation
- pandas: User Guide — pandas 2.1.3 documentation - guides that gradually build your pandas skills
- pandas: Series — pandas 2.1.3 documentation - series api references
- zen of python (add list of principles)
- pandas: how to use v3 + understand how it uses pyarrow as the default backend instead of numpy?
- course: Learn Backend Development the Fun Way | Boot.dev
- flask: API — Flask Documentation (3.0.x) - Flask v3 API
- flask: python - Get the data received in a Flask request - Stack Overflow - StackOverflow
- uv: Python packaging in Rust -
uv
is a faster alternative topip
andpip-tools
(from the creators ofruff
) - How to execute a file within the Python interpreter? - Stack Overflow - StackOverflow
- Common Gotchas — The Hitchhiker’s Guide to Python
- The Hitchhiker’s Guide to Python! — The Hitchhiker’s Guide to Python
- flask: API — Flask Documentation (3.0.x) - use
flask.request
to see the dataflask
parsed about the incoming request - Get Started — pytest documentation
- 1. Command line and environment — Python 3.12.2 documentation - Python docs
- Python’s assert: Debug and Test Your Code Like a Pro – Real Python - Real Python
- Modern Python logging - mCoding
- Flask contexts (And how to use them) | Moving rocks around - Diego Quintana
- threading — Thread-based parallelism — Python 3.12.3 documentation - Python docs
- multiprocessing — Process-based parallelism — Python 3.12.3 documentation - Python docs
- yukinarit/pyserde: Yet another serialization library on top of dataclasses, inspired by serde-rs.
- sparckles/Robyn: Robyn is a Super Fast Async Python Web Framework with a Rust runtime.
- robyn: Using Rust to write scalable Python APIs - Isaac Harris-Holt
- Python speed optimization options:
- Run with
pypy
instead ofpython
- Compile to C with
mypyc
based on standard Python type hints: - Use NumPy + Numba for number crunching:
- numba: Make Python 1000x Faster With One Line 🐍 ⏩ (Numba Tutorial) - The Builder
- Rewrite CPU-bound functions in Rust and call from Python:
- Making Python 100x faster with less than 100 lines of Rust - Using maturin to implement performance-critical functions in Rust while still writing your project in Python overall - Tea and Bits
- Compiled Python is FAST - Doug Mercer
- Turn Python BLAZING FAST with these 6 secrets - Dreams of Code
- Run with
- wimglenn/advent-of-code-data: Get your Advent of Code data with a single import statement
- Advent of Code: Solving Your Puzzles With Python – Real Python - Real Python
- Typer - CLI framework by the makers of FastAPI
- Robust Python: Write Clean and Maintainable Code: Viafore, Patrick: 9781098100667: Books - Amazon.ca - Patrick Viafore
- “Parsing” in Python | data Blog = Blog { me :: Programmer, posts :: [Opinion] }
- Parse, don’t validate - Python edition · Stian Lågstad - Stian Lågstad
- marshmallow: simplified object serialization — marshmallow 3.21.3 documentation
- Validators approach in Python - Pydantic vs. Dataclasses | Codetain - end-to-end software development - Hubert Kuszyński
- Android and iOS App to Learn Python | Programiz
- Learn NumPy: NumPy Tutorial for Beginners - Programiz
- google apis python sdk: Python YouTube API Tutorial: Using OAuth to Access User Accounts • How to fetch the access token needed to make OAuth-authenticated requests to the YouTube API and automatically refresh the short-lived access token using the long-lived refresh token without requiring additional user interaction if it has expired • Corey Shafer 📖
- google apis python sdk: Getting Started with Google APIs in Python | Martin Heinz | Personal Website & Blog • Martin Heinz 📺
- Python itertools - The key to mastering iteration - mCoding
- testing: property testing: hypothesis: Your Python code is almost entirely untested • How to unit test the properties of a function using randomly-generated inputs rather than relying only on a small number of specific example inputs • Doug Mercer 📺
- django: unfoldadmin/turbo: Django & Next.js boilerplate
- pydantic: Should I use pydantic for all my classes? : r/Python - Recommends only using Pydantic to parse and validate user/API input and to use dataclasses for all data created by the developer to save the runtime cost of Pydantic’s validations - Reddit
- Automate the Boring Stuff with Python - Al Sweigart (free online book)
- Automate the Boring Stuff with Python Programming Course | Udemy - Al Sweigart (Udemy course)
- Beyond the Basic Stuff with Python - Al Sweigart (free online book)
- Beyond the Basic Stuff with Python - Al Sweigart - Part 1 - Al Sweigart (video playlist)
- The Big Book of Small Python Projects - Al Sweigart (free online book)
- Invent Your Own Computer Games with Python • Al Sweigart (free online book)
- Making Games with Python & Pygame • Free online book • Al Sweigart 📕
- The Python Standard Library — Python 3.12.4 documentation
- Programming with Python - Edinburgh Carpentries
- dictionary - Why do we need a dict.update() method in python instead of just assigning the values to the corresponding keys? - Stack Overflow - Stack Overflow
- FastHTML - Modern web applications in pure Python
- Python Quick Tip: Secure Passwords and Sensitive Info with DotEnv • Corey Schafer 📺
- Effective Python › The Book: Second Edition • Brett Slatkin 📕
- Iterating over Files in a Directory • Using os and glob libraries • Rob Mulla 📺
- Protocols in Python: Why You Need Them - presented by Rogier van der Geer • Protocols offer a way to combine the best aspects of static and dynamic typing • EuroPython Conference 📺
- Running scripts - uv • How to use uv to manage and run single-file Python scripts • Astral 📚
- Pydantic Tutorial • Solving Python’s Biggest Problem • pixegami 📺
- Click Documentation (8.1.x)
- Things I’ve learned about building CLI tools in Python - Simon Willison
- Python Dataclasses: From Basic to Advanced Features • Excellent summary of how dataclasses work • Alex Mux 📺
- uv IS the Future of Python Packaging 🐍📦 • Hynek Schlawack 📺
- jvns/pandas-cookbook - Recipes for using Python’s pandas library - Julia Evans
- HTTPX
- Usage — icontract 2.7.1 documentation
- Dependency Injector — Dependency injection framework for Python — Dependency Injector 4.43.0 documentation
- JulienPalard/Pipe: A Python library to use infix notation in Python
- Toolz - Functional programming helpers (like
pipe
) for Python - FireDucks : Pandas but 100x faster | ฅ^•ﻌ•^ฅ ✨✨ HWisnu’s blog ✨✨ о ฅ^•ﻌ•^ฅ - HWisnu’s blog