#250
What started as a series on my blog Improve & Repeat reached now the milestone of 250 posts. This is not only a point to celebrate, but also a good opportunity to move Python Friday to its own site. From now on you find all parts of the series on PythonFriday.dev. Please update your RSS reader and point it to this feed to stay up to date.
Here you can see the list of all previously released posts grouped by topic - I hope you enjoy it!
Great Resources to learn Python
From the many Python tutorials online, I can recommend these here and suggest that you take a look at the videos from PyCon and the podcasts on Python:
- #1: Let’s Learn Python (2020-01-03)
- #2: Resources to Learn Python (2020-01-10)
- #14: 5 Python Courses on Pluralsight You Should Not Miss (2020-04-03)
- #28: Python Podcasts (2020-07-10)
- #29: Humble Software Bundle for Python (2020-07-17)
- #52: 1 Year of Python Friday (2021-01-01)
- #72: PyCon US 2021 (2021-05-21)
Fundamentals of the Python language
Here are my posts on the Python language itself, that cover some basic parts, some trivia and a few edge cases that may help you:
- #11: The Zen of Python (2020-03-13)
- #3: Numbers, Booleans & None (2020-01-17)
- #4: Lists, Dictionaries, Sets & Tuples (2020-01-24)
- #5: Strings (2020-01-31)
- #6: Control Structures (2020-02-07)
- #7: Functions (2020-02-14)
- #8: Modules (2020-02-21)
- #9: Classes (Part 1) (2020-02-28)
- #10: Classes (Part 2) (2020-03-06)
- #12: Exceptions (2020-03-20)
- #16: Working With Files (2020-04-17)
- #18: Working With the File System (2020-05-01)
- #22: Lambda Functions (2020-05-29)
- #24: Multiple Return Values? (2020-06-12)
- #26: The dir() Function (2020-06-26)
- #30: List Comprehension (2020-07-24)
- #37: Decorators (2020-09-11)
- #48: Yield and Generators (2020-11-27)
- #61: Slow Down Your Python Code (2021-03-05)
- #66: Generate Random Numbers (2021-04-09)
- #67: Generate Random Data From a Sequence (2021-04-16)
- #94: Store Your Objects With Pickle (2021-10-22)
- #95: Working With JSON (2021-10-29)
- #99: Iterate in Reversed Order Through Your Lists (2021-11-26)
- #17: What is PEP? (2020-04-24)
- #108: Getting Input From the Command Line (2022-02-04)
- #120: Modify the Create Date of a File (2022-04-29)
- #129: Copy & Paste With Python (2022-07-01)
- #130: Different File Encodings Between Windows and Linux (2022-07-08)
- #133: Minimalistic DTOs in Python (2022-07-29)
- #134: Date and Time in Python (Part 1: Date) (2022-08-05)
- #135: Date and Time in Python (Part 2: Datetime) (2022-08-12)
- #136: Date and Time in Python (Part 3: dateutil) (2022-08-19)
- #202: Rounding in Python (2023-11-24)
- #205: Monkey Patching (2023-12-15)
- #206: What Is the Meaning of ** and * in Parameters and Method Calls? (2023-12-22)
- #207: Type Hints (2023-12-29)
- #208: Working With Lists and Dictionaries (2024-01-05)
- #209: Defaultdict (2024-01-12)
- #210: Cache Function Calls (2024-01-19)
- #211: First Steps With Regular Expressions (2024-01-26)
- #212: Regular Expressions With Metacharacters (2024-02-02)
- #213: Tune the Garbage Collector (2024-02-09)
- #215: Async & Await (2024-02-23)
Your Python environment and your IDE
Python needs a runtime environment to fully leverage its potential and a good integrated development environment (IDE) makes your coding less cumbersome:
- #19: Working with Packages in Python (2020-05-08)
- #20: Creating Virtual Environments (2020-05-15)
- #21: Manage Your Dependencies (2020-05-22)
- #55: Separate Development From Runtime Dependencies (2021-01-22)
- #70: Keep Your Python Version up to Date (2021-05-07)
- #23: Visual Studio Code for Python (2020-06-05)
- #25: Helpful Resources for VS Code and Python (2020-06-19)
- #203: Is Your Python Version Still Maintained? (2023-12-01)
Log messages and documentation
With good log messages and documentation, you will understand your code later on when you come back after spending a few months on other projects.
- #62: Logging in Python (2021-03-12)
- #63: Logging in Flask (2021-03-19)
- #64: Structured Log Messages for Seq (2021-03-26)
- #65: Log from Flask to Seq (2021-04-02)
- #13: Add Comments to Your Code (2020-03-27)
- #15: Documenting Your Code (2020-04-10)
Test your code with pytest
The more important your application gets, the more you should test it:
- #44: Start With Pytest (2020-10-30)
- #45: Show the Print() Output in the Test Summary (2020-11-06)
- #46: Testing Exceptions in Pytest (2020-11-13)
- #47: (Built-in) Fixtures in Pytest (2020-11-20)
- #49: Creating Your Own Fixtures for Pytest (2020-12-04)
- #50: Speed up Pytest With Markers (2020-12-11)
- #51: Parametrised Tests With Pytest (2020-12-18)
- #53: Code Coverage for Pytest (2021-01-08)
- #54: Create a Report for Your Test Results With Pytest (2021-01-15)
- #56: 3 Useful Command-Line Options for Pytest (2021-01-29)
- #60: Change the Look & Feel of Pytest With Pytest-Sugar (2021-02-26)
- #68: Use Doctest to Test Your Documentation (2021-04-23)
- #69: Dynamic Output and Doctest (2021-04-30)
- #239: Asynchronous Tests With Pytest (2024-08-09)
Access your database with SQLAlchemy
The database framework SQLAlchemy offers an incredible flexibility to access your data:
- #92: Where to Start With SQLAlchemy (2021-10-08)
- #73: First Steps with SQLAlchemy (2021-05-28)
- #74: Important Concepts in SQLAlchemy (2021-06-04)
- #75: CRUD With Raw SQL in SQLAlchemy Core (2021-06-11)
- #76: CRUD With Metadata in SQLAlchemy Core (2021-06-18)
- #77: Filters in SQLAlchemy Core (2021-06-25)
- #78: Relationship Patterns in SQLAlchemy Core (2021-07-02)
- #79: JOINs in SQLAlchemy Core (2021-07-09)
- #80: Creating the Foundation for SQLAlchemy ORM (2021-07-16)
- #81: CRUD in SQLAlchemy ORM (2021-07-23)
- #82: Filters in SQLAlchemy ORM (2021-07-30)
- #83: Relationship Patterns in SQLAlchemy ORM (2021-08-06)
- #84: Working With Relational Data in SQLAlchemy ORM (2021-08-13)
- #85: Eager Loading vs Lazy Loading in SQLAlchemy ORM (2021-08-20)
- #86: Database Migrations With Alembic and SQLAlchemy (2021-08-27)
- #87: Handling Pre-Existing Tables With Alembic and SQLAlchemy (2021-09-03)
- #88: Activate Batch Mode in Alembic to Work With Constraints in SQLite (2021-09-10)
- #89: Constraints, Indexes and Default Values in SQLAlchemy ORM (2021-09-17)
- #90: SQL Server Connection Strings for SQLAlchemy (2021-09-24)
- #91: Automap for SQLAlchemy ORM (2021-10-01)
- #232: Update SQLAlchemy to Version 2.x (2024-06-21)
Data visualization
Preparing data and visualizing it was the biggest block of posts. This covers Pandas, NumPy, Matplotlib, Seaborn, Plotly, and Dash:
- #103: Working With CSV Files in Pandas (2021-12-31)
- #104: Creating a Pivot Table in Pandas (2022-01-07)
- #109: Set Operations on Lists With NumPy (2022-02-11)
- #160: Jupyter Notebooks for Your Data Analysis (2023-02-03)
- #161: Organise Data and Code in Jupyter Notebooks (2023-02-10)
- #162: Tips & Tricks to Work Effectively With JupyterLab (2023-02-17)
- #163: Share Your Jupyter Notebooks (2023-02-24)
- #164: Visualise Data With Matplotlib (2023-03-03)
- #165: Figures and Axes in Matplotlib (2023-03-10)
- #166: Export your Matplotlib Plots (2023-03-17)
- #167: Often used Diagrams for Matplotlib (2023-03-24)
- #168: Customise Your Plots in Matplotlib (2023-03-31)
- #169: Style Your Plots in Matplotlib (2023-04-07)
- #170: XKCD Styled Plots for Matplotlib (2023-04-14)
- #171: Annotate Your Matplotlib Plots (2023-04-21)
- #172: Combine Multiple Plots in Matplotlib (2023-04-28)
- #175: Visualise Data in Pandas With Plot() (2023-05-19)
- #176: Visualise Data in Pandas With Hist() & Boxplot() (2023-05-26)
- #177: Customise Your Plots in Pandas (2023-06-02)
- #178: Clean-up Your Data With Pandas (2023-06-09)
- #179: Explore Your Data With Pandas (2023-06-16)
- #180: Explore Your Data With Seaborn (2023-06-23)
- #181: Making Sense of Your Data With Seaborn (2023-06-30)
- #182: Style Your Plots in Seaborn (2023-07-07)
- #183: Advanced Tips & Tricks for JupyterLab (2023-07-14)
- #184: Performance-Related Magic Commands in Jupyter (2023-07-21)
- #185: Creating DataFrames in Pandas (2023-07-28)
- #186: Filter Data in Pandas (2023-08-04)
- #187: Extracting the NDC Talks Data From YouTube (2023-08-11)
- #188: Working With the NDC Talks Data (2023-08-18)
- #189: Visualize Text With a Word Cloud (2023-08-25)
- #190: Interactive Plots With Plotly (2023-09-01)
- #191: Often used Diagrams for Plotly (2023-09-08)
- #192: Plotly-Specific Diagrams (2023-09-15)
- #193: Choosing Colours for Plotly (2023-09-22)
- #194: Templates for Plotly (2023-09-29)
- #195: Customise Your Plots in Plotly (2023-10-06)
- #196: Engine Troubles When Saving Plots With Plotly (2023-10-13)
- #197: Creating Interactive Dashboards With Dash (2023-10-20)
- #198: Multi-Component Dashboards with Dash (2023-10-27)
- #199: Adding Dash to an Existing Flask Application (2023-11-03)
Creating web applications with Flask
If you want to build a web application in Python I can recommend the Flask framework:
- #32: First Steps With Flask (2020-08-07)
- #33: Activate Auto-Reload for Flask in VS Code (2020-08-14)
- #34: Jinja Templates (2020-08-21)
- #35: Shared Layouts in Jinja (2020-08-28)
- #36: Routing in Flask (2020-09-04)
- #38: Forms for Your Flask App (2020-09-18)
- #39: Form Validation for Your Flask App (2020-09-25)
- #40: Form Validation for Your Flask App With ViewModels (2020-10-02)
- #41: Structure Your Flask App (2020-10-09)
- #42: Using Blueprint to Clean-up Your View Functions File (2020-10-16)
- #43: Add Security Headers to Your Flask Application (2020-10-23)
FastAPI
If you like Flask for web applications, you should look at FastAPI for APIs:
- #214: First Steps With FastAPI (2024-02-16)
- #216: Test Your FastAPI Application (2024-03-01)
- #217: Path- and Query Parameters in FastAPI (2024-03-08)
- #218: Send Data to FastAPI (2024-03-15)
- #219: Structure your FastAPI Application (2024-03-22)
- #220: Manage To-Dos With FastAPI (2024-03-29)
- #221: Refactor the FastAPI To-Do Application (2024-04-05)
- #222: Filter the Tasks in the FastAPI Application (2024-04-12)
- #223: Better Pydantic Models for FastAPI (2024-04-19)
- #224: Better HTTP Status Codes for FastAPI (2024-04-26)
- #225: Set a Response Header With FastAPI (2024-05-03)
- #226: Fine-Tune the OpenAPI Documentation in FastAPI (2024-05-10)
- #227: Hash a Password With Bcrypt (2024-05-17)
- #228: HTTP Basic Authentication in FastAPI (2024-05-24)
- #229: OAuth2 and JWT to Protect a FastAPI Application (2024-05-31)
- #230: Fix the PydanticJsonSchemaWarning in FastAPI (2024-06-07)
- #231: Split a FastAPI Application Into Manageable Parts (2024-06-14)
- #233: SQLAlchemy and FastAPI (2024-06-28)
- #234: Database Tests for the FastAPI Application (2024-07-05)
- #235: DB Migrations With Alembic and FastAPI (2024-07-12)
- #236: Add a Web Interface to FastAPI (2024-07-19)
- #237: Static Routes in FastAPI (2024-07-26)
-
#238: Create a Dashboard for FastAPI (2024-08-02)
-
#240: Asynchronous SQLAlchemy With FastAPI (2024-08-16)
- #241: Filters for SQLAlchemy and FastAPI (2024-08-23)
- #242: API Versioning in FastAPI (2024-08-30)
- #243: Rate Limit in FastAPI (2024-09-06)
- #244: Integrate FastAPI Users Into the To-Do Application (2024-09-13)
- #245: Run FastAPI in Docker & in Production (2024-09-20)
- #246: Helpful Tricks for FastAPI (2024-09-27)
MkDocs
Not only can you use MkDocs for your project documentation, but it supports everything you need to power your blog.
- #57: Introduction to MkDocs (2021-02-05)
- #58: Customise MkDocs (2021-02-12)
- #59: Source Code in MkDocs (2021-02-19)
- #247: Static Site Generators for a Blog? (2024-10-04)
- #248: MkDocs for a Blog (2024-10-11)
- #249: Migrate from WordPress to Markdown? (2024-10-18)
Web crawling and browser automation
Another big topic was web crawling and browser automation. For that we used feedparser, request, BeautifulSoup, Selenium, Playwright and BrowserStack:
- #102: Parse Atom and RSS Feeds With Feedparser (2021-12-17)
- #137: HTTP With Requests (2022-08-26)
- #138: Parsing HTML With Beautiful Soup (2022-09-02)
- #139: Parse Sitemaps With Python (2022-09-09)
- #140: Create a Basic Link Checker (2022-09-16)
- #141: Read TLS/SSL Certificates in Python (2022-09-23)
- #142: First Steps With Selenium (2022-09-30)
- #143: Driver Manager for Selenium (2022-10-07)
- #144: Automate Browsers With Selenium (Part 1) (2022-10-14)
- #145: Automate Browsers With Selenium (Part 2) (2022-10-21)
- #146: Download Jetpack Statistics With Selenium (2022-10-28)
- #147: End-To-End Tests With Selenium and Pytest (2022-11-04)
- #148: Selenium Grid With Docker (2022-11-11)
- #149: Multiple Browsers in Selenium Grid (2022-11-18)
- #150: Create a Dynamic Selenium Grid (2022-11-25)
- #151: Create Videos With Selenium Grid (2022-12-02)
- #152: Playwright for Python (2022-12-09)
- #153: Automate Browsers With Playwright (2022-12-16)
- #154: Figure Out Where Playwright Went Wrong (2022-12-23)
- #155: Download Jetpack Statistics With Playwright (2022-12-30)
- #156: Connect Playwright to BrowserStack and Selenium Grid (2023-01-06)
- #204: Using Feedparser With Self-Signed Certificates (2023-12-08)
Delayed jobs
If you want to run your jobs asynchronously, you should read these posts on RabbitMQ and Celery:
- #121: RabbitMQ and Python (2022-05-06)
- #122: Asynchronous Jobs With Celery (2022-05-13)
- #123: Running Celery on Windows (2022-05-20)
- #124: Delay Jobs in Celery (2022-05-27)
- #125: Logging in Celery (2022-06-03)
- #126: Flask and Celery (2022-06-10)
- #127: Track the State of a Celery Task (2022-06-17)
- #128: Periodic Tasks in Celery (2022-06-24)
Useful tools and libraries
Outside of the Python language are many great tools that you can integrate in your own applications:
- #27: Reading Exif Metadata From Images (2020-07-03)
- #31: HTTPie as a Curl Replacement (2020-07-31)
- #71: A Progress Bar for Your Python Script (2021-05-14)
- #96: Access Your Git Repository With PyDriller (2021-11-05)
- #93: Pretty Print for Python (2021-10-15)
- #97: Changing the Current Working Directory (2021-11-12)
- #98: Run Other Applications From Your Code (2021-11-19)
Miscellaneous
Besides all those bigger topics, there was room for some small and specific posts that can improve your development experience or help you to automate boring tasks:
- #101: Creating a Dev Container for Python (2021-12-10)
- #105: Multiply Strings in Python (2022-01-14)
- #106: Accessing Environment Variables in Python (2022-01-21)
- #107: Working With .env Files in Python (2022-01-28)
- #132: Rich Tables for Your Terminal Apps (2022-07-22)
- #157: Access Your Wi-Fi Passwords on Windows (2023-01-13)
- #158: Extract the Audio of an MP4 Video (2023-01-20)
- #159: Find the Missing C++ Build Tools (2023-01-27)
- #173: Create Graphs with NetworkX (2023-05-05)
- #174: Untangle Project Dependencies With NetworkX (2023-05-12)
- #201: How Much Cost a Print()? (2023-11-17)
Goodbye to Twitter
Twitter was a great site and accessing it through an API made many mundane tasks bearable. With the end of the API access and the renaming to X, you may no longer get much value out of these posts:
- #110: Accessing Twitter from Python (2022-02-18)
- #111: Twitter Authentication & Tweepy (2022-02-25)
- #112: How to Use Tweepy in Flask (2022-03-04)
- #113: Explore Friends and Followers With Tweepy (2022-03-11)
- #114: Debug Tweepy (2022-03-18)
- #115: Working With Twitter Lists in Tweepy (2022-03-25)
- #116: Search Twitter from Tweepy (2022-04-01)
- #117: Streaming Search Results With Tweepy (2022-04-08)
- #118: Block and Mute Accounts With Tweepy (2022-04-15)
- #119: Follow, Like and Retweet With Tweepy (2022-04-22)
- #131: Working With Bookmarks in Tweepy (2022-07-15)
Next
Next week we continue with the migration to MkDocs and tackle the HTTP redirects for Apache.