A weekly Python podcast hosted by Christopher Bailey with interviews, coding tips, and conversation with guests from the Python community.
The show covers a wide range of topics including Python programming best practices, career tips, and related software development topics.
Join us every Friday morning to hear what’s new in the world of Python programming and become a more effective Pythonista.
The podcast The Real Python Podcast is created by Real Python. The podcast and the artwork on this page are embedded on this page using the public podcast feed (RSS).
Are you interested in practicing your Python skills while learning how to solve astrophysics and astronomy problems? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a pair of his recent Real Python video courses about exploring astronomy and astrophysics with Python. Throughout the courses, you’ll get to practice using a variety of data science libraries, such as NumPy, Matplotlib, pandas, pint, and Astropy.
We speak with Mannie Young who is the Organizing Committee Chair of PyCon Africa. Real Python is excited to be a contributing sponsor of this year’s conference. Mannie discusses reinvigorating a continent-spanning conference after a multiyear hiatus. He also talks about introducing Python to students and new developers across Africa through PyClubs, PyLadies, and PyData programs.
We share several other articles and projects from the Python community, including a news roundup, logging in Python, understanding operator precedence, reconciling why it only works on your machine, a fast way to create an HTML app, and a tool for deep inspection of Python objects.
This episode is sponsored by InfluxData.
Course Spotlight: Sorting Dictionaries in Python: Keys, Values, and More
In this video course, you’ll learn how to sort Python dictionaries. By the end, you’ll be able to sort by key, value, or even nested attributes. But you won’t stop there, you’ll also measure the performance of variations when sorting and compare different key-value data structures.
Topics:
News:
Show Links:
print()
function to get information about the flow of your programs, then logging is the natural next step for you. This tutorial will guide you through creating your first logs and show you ways to curate them to grow with your projects.Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you interested in learning robotics with Python? Can physical electronics-based projects grow a child’s interest in coding? This week on the show, we speak with author Marwan Alsabbagh about his book “Build Your Own Robot - Using Python, CRICKIT, and Raspberry Pi.”
Marwan discusses his two conferences talks about building electronics projects with his children. He provides advice on equipment and techniques to make learning Python engaging.
We explore his robotics project and the literal balancing act of designing a robot around the Raspberry Pi. Marwan shares his successes and disappointments while working to incorporate computer vision, joystick controls, and voice commands.
This episode is sponsored by Mailtrap.
Course Spotlight: Python Debugging With pdb
In this hands-on course, you’ll learn the basics of using pdb, Python’s interactive source code debugger. pdb is a great tool for tracking down hard-to-find bugs, and it allows you to fix faulty code more quickly.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are the best practices for organizing data analysis projects in Python? What are the advantages of a more package-centric approach to data science? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss Joshua Cook’s recent article “How I Use Python to Organize My Data Analyses.” The article covers how his process for building data analysis projects has evolved and now incorporates modern Python packaging techniques.
Christopher shares his recent video course on grouping real-world data with pandas. The course offers a quick refresher before digging into how to use pandas GroupBy to manipulate, transform, and summarize data.
We also share several other articles and projects from the Python community, including a news roundup, working with JSON data in Python, running an Asyncio event loop in a separate thread, knowing the why behind a system’s code, a retro game engine for Python, and a project for vendorizing packages from PyPI.
This episode is sponsored by Mailtrap.
Course Spotlight: pandas GroupBy: Grouping Real World Data in Python
In this course, you’ll learn how to work adeptly with the pandas GroupBy while mastering ways to manipulate, transform, and summarize data. You’ll work with real-world datasets and chain GroupBy methods together to get data into an output that suits your needs.
Topics:
News:
test
command. Many packages promptly broke. The following day the change was undone.Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What hurdles must be cleared when starting an international organization? How do you empower others in a community by sharing responsibilities? This week on the show, we speak with Jay Miller about Black Python Devs.
Jay shares how the idea of forming a community began through attending conferences. They wanted to welcome more black developers into the Python community. We discuss the introduction of Black Python Devs as part of their PyCon 2024 keynote presentation.
Jay explains working with a few key people to build the group’s foundations. They talk about the difficulty of letting other people share in the responsibilities and ownership as the membership grew. We also discuss the advantages of partnering with a non-profit organization.
This episode is sponsored by InfluxData.
Course Spotlight: Interacting With REST APIs and Python
In this video course, you’ll learn how to use Python to communicate with REST APIs. You’ll learn about REST architecture and how to use the requests library to get data from a REST API. You’ll also explore different Python tools you can use to build REST APIs.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you integrate GraphQL into your Python web development? How about quickly building graph-based APIs inside Django’s battery-included framework? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a recent tutorial for building GraphQL APIs in Django using the Python library Strawberry. The tutorial digs into creating a project, defining models, and creating GraphQL queries and mutations using Strawberry.
We discuss a blog post from Nat Bennet titled “Why do prototypes suck?” We dig into the common pitfalls of building prototypes and the misconceptions between developers and end users.
We also share several other articles and projects from the Python community, including a news roundup, using HTMX with FastAPI, creating an unbelievably stupid airline Wi-Fi package, extracting wisdom from conference videos, writing pixel images to the terminal, and a macOS app for Jupyter Notebooks.
This episode is sponsored by Mailtrap.
Course Spotlight: Building a URL Shortener With FastAPI and Python
In this video course, you’ll build an app to create and manage shortened URLs. Your Python URL shortener can receive a full target URL and return a shortened URL. You’ll also use the automatically created documentation of FastAPI to try out your API endpoints.
Topics:
News:
Topics:
Discussion:
Project:
Additional Links:
Level up your Python skills with our expert-led courses:
Do you need help making data tables in Python look interesting and attractive? How can you create beautiful display-ready tables as easily as charts and graphs in Python? This week on the show, we speak with Richard Iannone and Michael Chow from Posit about the Great Tables Python library.
Michael and Richard discuss the design philosophy and history behind creating display tables. We dig into the grammar of tables, the background of the project, and an ingenious way to build a collection of examples for a library.
We briefly cover how Richard and Michael started contributing to open source. We also discuss practicing data skills with challenges and resources like Tidy Tuesday.
This episode is sponsored by Mailtrap.
Course Spotlight: Graph Your Data With Python and ggplot
In this course, you’ll learn how to use ggplot in Python to build data visualizations with plotnine. You’ll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are discrete optimization problems? How do you solve them with constraint programming in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects
Christopher discusses an article about constraint programming using Python. He describes the fundamentals and how the problems resemble logic problems you may have experienced in school. The article shows how to solve a weekly work scheduling problem using the open-source CP-SAT package.
We discuss Leodanis Pozo Ramos’s recent tutorial, “Python’s Built-in Functions: A Complete Exploration.” These functions are available for use directly in your code without importing.
We also share several other articles and projects from the Python community, including a news roundup, spotting ships with satellites, grappling with Apple’s App Store rejecting Python applications, considering changes to Python’s security model, discussing pivoting from one development path to another, prettifying Jinja and Django templates, and generating static sites with Python.
This episode is sponsored by Sentry.
Course Spotlight: Parallel Iteration With Python’s zip() Function
In this course, you’ll learn how to use the Python zip() function to solve common programming problems. You’ll learn how to traverse multiple iterables in parallel and create dictionaries with just a few lines of code.
Topics:
xz-utils
BackdoorNews:
Show Links:
urllib
parser module in Python references a scheme for apps that use the iTunes feature to install other apps, which is disallowed. Auto scanning by Apple is rejecting any app that uses Python 3.12 underneath. A solution has been proposed for Python 3.13.xz-utils
Backdoor – The backdoor introduced to the xz-utils
compression project through social engineering was one of the topics at the Python Language Summit. Participants discussed what can be done to prevent similar social engineering attacks on the Python source.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you wondered about graph theory and how to start exploring it in Python? What resources and Python libraries can you use to experiment and learn more? This week on the show, former co-host David Amos returns to talk about what he’s been up to and share his knowledge about graph theory in Python.
David started a Ph.D. program studying mathematics, with a focus on graph theory. Though life interrupted his pursuit after three years, he is still passionate about the subject. He’s been using these skills to create documentation and teach users as part of RelationalAI’s education team.
David has also been exploring the Julia programming language. He wrote about it on his blog, created videos, and started a podcast on the topic. He shares his excitement about learning new techniques from different languages and how these ideas can enhance your coding in Python.
This episode is sponsored by Sentry.
Course Spotlight: Defining Python Constants for Code Maintainability
In this video course, you’ll learn how to properly define constants in Python. By coding a bunch of practical example, you’ll also learn how Python constants can improve your code’s readability, reusability, and maintainability.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Does Python round numbers the same way you learned back in math class? You might be surprised by the default method Python uses and the variety of ways to round numbers in Python. Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher discusses his recent video course, “Rounding Numbers in Python.” He covers rounding bias and how to avoid introducing it into your dataset. We dig into the various rounding strategies and how to implement them in Python.
We also share several other articles and projects from the Python community, including a news roundup, a fast Python linter for error-free and maintainable code, the decline of the user interface, more thoughts on Python in Excel, a discussion about calendar versioning for Python, a financial database as a Python module, and a project to prettify the colors of your terminal user interfaces.
This episode is sponsored by Sentry.
Course Spotlight: Rounding Numbers in Python
In this video course, you’ll learn about the mistakes you might make when rounding numbers and how to best manage or avoid them. It’s a great place to start for the early to intermediate Python developer who’s interested in using Python for finance, data science, or scientific computing.
Topics:
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What techniques go into synthesizing a guitar sound in Python? What higher-level programming and Python concepts can you practice while building advanced projects? This week on the show, we talk with Real Python author and core team member Bartosz Zaczyński about his recent step-by-step project, Build a Guitar Synthesizer: Play Musical Tablature in Python.
Bartosz shares how he had built an early prototype of the guitar synth using a different language. He describes recreating the Karplus-Strong algorithm in Python to create the plucked guitar sounds. We discuss teaching advanced Python concepts while guiding readers through constructing a complete project.
We also dig into reading and writing WAV files in Python, using Spotify’s pedalboard library, implementing Poetry in a project, and designing a file format for guitar tablature.
This episode is sponsored by Mailtrap.
Course Spotlight: Playing and Recording Sound in Python
In this course, you’ll learn about libraries that can be used for playing and recording sound in Python, such as PyAudio and python-sounddevice. You’ll also see code snippets for playing and recording sound files and arrays, as well as for converting between different sound file formats.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are the built-in Python modules that can work as useful command-line tools? How can these tools add more functionality to Windows machines? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares an article by Trey Hunner about Python’s extensive collection of command-line utilities? The piece digs into general-purpose tools that format JSON data or start a simple web server and additional utilities for working with your Python code from the terminal.
We cover a set of Jupyter Notebooks for teaching and learning the art of music processing and Music Information Retrieval (MIR). The notebooks are resources for working through the textbook, “Fundamentals of Music Processing: Audio, Analysis, Algorithms, Applications.”
We also share several other articles and projects from the Python community, including a news roundup, a discussion of CRUD operations, a description of Python’s built-in bytes sequence, favorite essays on development and programming, Python resources for working with Excel, and a project for creating finite state machines in Python.
This episode is sponsored by APILayer.
Course Spotlight: Binary, Bytes, and Bitwise Operators in Python
In this course, you’ll learn how to use Python’s bitwise operators to manipulate individual bits of data at the most granular level. With the help of hands-on examples, you’ll see how you can apply bitmasks and overload bitwise operators to control binary data in your code.
Topics:
News:
dataclasses.field
” was determined to have an insufficient number of use cases.Show Links:
python -m module_name
.bytes
: The Lesser-Known Python Built-in Sequence – The bytes
data type looks a bit like a string, but it isn’t a string. This article explores it and also looks at the main Unicode encoding, UTF-8Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How do you find the most interesting or suspicious points within your data? What libraries and techniques can you use to detect these anomalies with Python? This week on the show, we speak with author Brett Kennedy about his book “Outlier Detection in Python.”
Brett describes initially getting involved with detecting outliers in financial data. He discusses various applications and techniques in security, manufacturing, quality assurance, and fraud. We also dig into the concept of explainable AI and the differences between supervised and unsupervised learning.
This episode is sponsored by APILayer.
Course Spotlight: Using k-Nearest Neighbors (kNN) in Python
In this video course, you’ll learn all about the k-nearest neighbors (kNN) algorithm in Python, including how to implement kNN from scratch. Once you understand how kNN works, you’ll use scikit-learn to facilitate your coding process.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you effectively break a software problem into individual steps? What are signs you’re writing overly clever code? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss an article about de-warping images of book pages. We both found the piece a good study on decomposing a complex software problem.
Christopher discusses an article titled “Clever code is probably the worst code you could write.” Early in a programming career, it’s easier to write complex and difficult-to-read code. The real challenge is progressing towards writing clearer and readable code.
We also share several other articles and projects from the Python community, including a news roundup, what the __pycache__
folder is for in Python, what’s new in Django 5.1, a discussion about software engineering hiring and firing, a project for setting up repeated tasks, and a simple way to create reusable template components in Django.
This episode is sponsored by Sentry.
Course Spotlight: Efficient Iterations With Python Iterators and Iterables
In this video course, you’ll learn what iterators and iterables are in Python. You’ll learn how they differ and when to use them in your code. You’ll also learn how to create your own iterators and iterables to make data processing more efficient.
Topics:
__pycache__
Folder in Python?News:
Show Links:
__pycache__
Folder in Python? – In this tutorial, you’ll explore Python’s __pycache__
folder. You’ll learn about when and why the interpreter creates these folders, and you’ll customize their default behavior. Finally, you’ll take a look under the hood of the cached .pyc files.Discussion:
Projects:
Level up your Python skills with our expert-led courses:
How do you start adding unit tests to your Python code? Can the built-in unittest framework cover most or all of your needs? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We dig into a recent tutorial by Leodanis Pozo Ramos about writing unit tests using Python’s unittest. The tutorial covers organizing your tests, exploring assert methods, creating test fixtures, and debugging failing tests.
We explore a collection of Python data visualizations and tutorials from the Python Graph Gallery. The website features hundreds of charts and graphs built using popular plotting libraries. Each chart type features a foundational tutorial that introduces the structure and application.
We also share several other articles and projects from the Python community, including a news roundup, the new REPL coming in Python 3.13, a pytest daemon to 10X test iteration speed, a discussion about software friction, a Raspberry Pi document scanner, and a project for controlling time per iteration loop.
Course Spotlight: Building a Python GUI Application With Tkinter
In this video course, you’ll learn the basics of GUI programming with Tkinter, the de facto Python GUI framework. Master GUI programming concepts such as widgets, geometry managers, and event handlers. Then, put it all together by building two applications: a temperature converter and a text editor.
Topics:
unittest
: Writing Unit Tests for Your CodeNews:
Show Links:
unittest
: Writing Unit Tests for Your Code – In this tutorial, you’ll learn how to use the unittest framework to create unit tests for your Python code. Along the way, you’ll also learn how to create test cases, fixtures, test suites, and more.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What’s it like to learn Python as a visually impaired or blind developer? How can you improve the accessibility of your Python web applications and learn current guidelines? This week on the show, Real Python community member Audrey van Breederode discusses her programming journey, web accessibility, and assistive technology.
Audrey shares her background as a system administrator and instructor. While she was learning Python, she discovered Real Python. Audrey provided some feedback about the built-in video player’s accessibility. Dan reached out and worked with Audrey on some website improvements for the visually impaired.
We discuss navigating modern websites and using assistive technology. Audrey also provides resources Python developers can use to improve the accessibility of their applications.
Course Spotlight: HTML and CSS Foundations for Python Developers
There’s no way around HTML and CSS when you want to build web apps. Even if you’re not aiming to become a web developer, knowing the basics of HTML and CSS will help you understand the Web better. In this video course, you’ll get an introduction to HTML and CSS for Python programmers.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like to get more practice working with APIs in Python? How about exploring the globe using the data from OpenStreetMap? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We share an article from the Pybites blog about building queries using the Overpass API for OpenStreetMap. The post explores the data structures, tags, query formats, and how to use Overpass in Python.
Christopher discusses a Real Python article by recent guest Stephen Gruppetta about lazy evaluation in Python. The piece covers the advantages of generator expressions or functions and the potential disadvantages of using lazy versus eager evaluation methods.
We also share several other articles and projects from the Python community, including a news roundup, handling control-c in asyncio, preventing data leakage in pandas and scikit-learn, discussing the Django developer survey results, asking developers why they aren’t shipping faster, using UV to install into isolated environments, and a couple of tools for retrying in Python.
This episode is sponsored by Sentry.
Course Spotlight: How to Set Up a Django Project
In this course, you’ll learn the necessary steps that you’ll need to take to set up a new Django project. You’ll learn the basic setup for any new Django project, which needs to happen before programming the specific functionality of your project.
Topics:
News:
Show Links:
asyncio
.pandas
& scikit-learn
– How you impute missing values in machine learning data sets can affect the quality of your training. This article teaches you what data leakage is and what steps you should take to avoid it.Discussion
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Do you get stressed while trying to learn Python? Do you prefer to build small programs or projects as you continue your coding journey? This week on the show, Real Python author Stephen Gruppetta is here to talk about his new book, “The Python Coding Book.”
Stephen has been teaching Python to adults and children for many years. With his new book, he wants to share the relaxed and friendly learning environment he’s developed. We discuss using analogies to explain programming concepts and constructing complete programs as chapter goals.
Over the last year, Stephen focused on writing. He started his newsletter, The Python Coding Stack, wrote more tutorials for Real Python and authored the book.
This episode is sponsored by Mailtrap.
Course Spotlight: Python Basics: Code Your First Python Program
In this video course, you’ll write your first Python program. Along the way, you’ll learn about errors, declare variables and inspect their values, and try your hand at writing comments.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you verify and validate the data coming into your Python web application? What tools and security best practices should you consider as a developer? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss the recent Real Python tutorial “Pydantic: Simplifying Data Validation in Python.” The piece covers installing the library with optional dependencies, working with base models, validating functions, and managing environment variables.
We continue our conversation about web development with another article about Python security best practices. This article covers several Python libraries and crucial steps you can take to help make your web-based applications more secure.
We also share several other articles and projects from the Python community, including a news roundup, why Python lists multiply oddly, inline run dependencies in pipx, a discussion about open-source contribution assignments, playing sounds in Python, and a Python library to access ISO country definitions.
This episode is sponsored by Mailtrap.
Course Spotlight: Using raise for Effective Exceptions
In this video course, you’ll learn how to raise exceptions in Python, which will improve your ability to efficiently handle errors and exceptional situations in your code. This way, you’ll write more reliable, robust, and maintainable code.
Topics:
pipx
1.4.2News:
Show Links:
pipx
1.4.2 – PEP 723 adds the ability to specify dependencies within a Python script itself. The folks who write pipx
have added an experimental feature that takes advantage of this future language change. This article shows you how the new feature looks and what pipx does with it.pipx
– In this tutorial, you’ll learn about a tool called pipx, which lets you conveniently install and run Python packages as standalone command-line applications in isolated environments. In a way, pipx turns the Python Package Index (PyPI) into an app marketplace for Python programmers.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What are the benefits of using a decoupled data processing system? How do you write reusable queries for a variety of backend data platforms? This week on the show, Phillip Cloud, the lead maintainer of Ibis, will discuss this portable Python dataframe library.
Phillip contrasts Ibis’s workflow with other Python dataframe libraries. We discuss how “getting close to the data” speeds things up and conserves memory.
He describes the different approaches Ibis provides for querying data and how to select a specific backend. We discuss ways to get started with the library and how to access example data sets to experiment with the platform.
Phillip discovered Ibis while looking for a tool that allowed him to reuse SQL queries written for a specific data platform on a different one. He recounts how he got involved with the Ibis project, sharing his background in open source and learning how to contribute to a first project.
This episode is sponsored by Mailtrap.
Course Spotlight: Creating Web Maps From Your Data With Python Folium
You’ll learn how to create web maps from data using Folium. The package combines Python’s data-wrangling strengths with the data-visualization power of the JavaScript library Leaflet. In this video course, you’ll create and style a choropleth world map showing the ecological footprint per country.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What is error culture, and how do you avoid it within your organization? How do you navigate alert and notification fatigue? Hey, it’s episode #200! Real Python’s editor-in-chief, Dan Bader, joins us this week to celebrate. Christopher Trudeau also returns to bring another batch of PyCoder’s Weekly articles and projects.
We discuss an article series about error culture. We dig into false positives, hero culture, and the tendency to start ignoring alerts. We contrast our personal experiences and propose possible remedies. Dan describes configuring Real Python’s alert system.
We also share several other articles and projects from the Python community, including a news roundup, reading and writing WAV files in Python, moving beyond flat files toward SQLite and SQLAlchemy, getting help in Python, exploring four kinds of optimization, a framework for building web scrapers, and a project to simply subprocesses.
This week’s episode is brought to you by Sentry.
Course Spotlight: SQLite and SQLAlchemy in Python: Move Your Data Beyond Flat Files
In this video course, you’ll learn how to store and retrieve data using Python, SQLite, and SQLAlchemy as well as with flat files. Using SQLite with Python brings with it the additional benefit of accessing data with SQL. By adding SQLAlchemy, you can work with data in terms of objects and methods.
Topics:
News:
Topics:
sleep()
was in the Python standard library, Ishaan stumbled through the built-in help and learned how to use it to answer just these kinds of questions.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How do you customize a LLM chatbot to address a collection of documents and data? What tools and techniques can you use to build embeddings into a vector database? This week on the show, Calvin Hendryx-Parker is back to discuss developing an AI-powered, Large Language Model-driven chat interface.
Calvin is the co-founder and CTO of Six Feet Up, a Python and AI consultancy. He shares a recent project for a family-owned seed company that wanted to build a tool for customers to access years of farm research. These documents were stored as brochure-style PDFs and spanned 50 years.
We discuss several of the tools used to augment a LLM. Calvin covers working with LangChain and vectorizing data with ChromaDB. We talk about the obstacles and limitations of capturing documentation.
Calvin also shares a smaller project that you can try out yourself. It takes the information from a conference website and creates a chatbot using Django and Python prompt-toolkit.
This episode is sponsored by Mailtrap.
Course Spotlight: Command Line Interfaces in Python
Command line arguments are the key to converting your programs into useful and enticing tools that are ready to be used in the terminal of your operating system. In this course, you’ll learn their origins, standards, and basics, and how to implement them in your program.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Can you build a Space Invaders clone using Python’s built-in turtle module? What advantages does the Seaborn data visualization library provide compared to Matplotlib? Christopher Trudeau is back on the show this week, along with special guest Real Python core team member Bartosz Zaczyński. We’re sharing another batch of PyCoder’s Weekly articles and projects.
Bartosz shares a Real Python step-by-step project for building a video game using the Python turtle module. The turtle module provides an interactive environment that lets users create pictures and shapes on a virtual canvas. The project takes you through game design concepts such as animating sprites, detecting a collision, and building a game loop.
We discuss another Real Python resource, “Visualizing Data in Python With Seaborn.” Seaborn is a significant next step if you’ve already been working with Matplotlib. It produces impressive visualizations and offers a functional or object-based approach to designing plots.
We also share several other articles and projects from the Python community, including a news roundup, finding Python Easter eggs, exploring whether Python has pointers, styling Excel cells with OpenPyXL, using weird tests to capture tacit knowledge, inspecting and running Django commands in a TUI, building reactive web UIs in Python, and a project for predictable Python datetimes.
This week’s episode is brought to you by Posit.
Course Spotlight: Python Turtle for Beginners
In this step-by-step course, you’ll learn the basics of Python programming with the help of a simple and interactive Python library called turtle. If you’re a beginner to Python, then this tutorial will definitely help you on your journey as you take your first steps into the world of programming.
Topics:
News:
Show Links:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How is Python being used to automate processes in the laboratory? How can it speed up scientific work with DNA sequencing? This week on the show, Chemical Engineering PhD Student Parsa Ghadermazi is here to discuss Python in bioinformatics.
Parsa provides background on his research and the bioinformatic techniques used to discover gut microbes’ role in human health and diseases. We talk about automating lab experiments with liquid handling robots and Python.
We dig into libraries to shatter and reassemble DNA sequences. Parsa also shares current projects from the Chan Lab at Colorado State University and his GitHub repository.
Course Spotlight: Building Python Project Documentation With MkDocs
In this video course, you’ll learn how to build professional documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and, more importantly, from your code’s docstrings.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are the advantages of determining the type of an object by how it behaves? What coding circumstances are not a good fit for duck typing? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher covers a recent Real Python tutorial by Leodanis Pozo Ramos titled Duck Typing in Python: Writing Flexible and Decoupled Code. The tutorial explains the concepts of duck typing within object-oriented programming and its use within Python’s built-in tools.
We discuss a recent article on monkey patching in Python. This practice of dynamically modifying a class or module’s behavior at runtime allows for testing, debugging, and experimentation.
We also share several other articles and projects from the Python community, including a news roundup, why names are not the same as objects in Python, using IPython Jupyter magic commands, a discussion about becoming a senior developer, a data exploration challenge, a Python evaluation game, and a terminal UI for regex testing.
This week’s episode is brought to you by Sentry.
Course Spotlight: Pointers and Objects in Python
In this video course, you’ll learn about Python’s object model and see why pointers don’t really exist in Python. You’ll also cover ways to simulate pointers in Python without managing memory.
Topics:
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How do you get yourself unstuck when facing a programming problem? How do you develop a positive developer mindset while learning Python? This week on the show, Bob Belderbos from Pybites is here to talk about learning Python and building healthy developer habits.
Bob created the Pybites learning platform with his friend Julian Sequeira. They initially focused on exercises and coding challenges to motivate new Python students. As they grew their community, they created a podcast and moved into coaching.
They noticed that most new developers share common struggles of tutorial paralysis, imposter syndrome, and motivation. Bob discusses techniques for developing a positive mindset, overcoming coding blocks, and delivering projects.
Course Spotlight: Grow Your Python Portfolio With 13 Intermediate Project Ideas
Get started on 13 Python project ideas that are just right for intermediate Python developers. They’ll challenge you enough to help you become a better Pythonista.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are the typical computer tasks you do manually every week? Could you automate those tasks with a Python script? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent Hacker News thread about frequently used automation scripts. We share the kinds of tasks we’ve automated with Python in our work and personal lives.
Christopher shares a tutorial about building a micro-search engine from scratch using Python. The post takes you through coding the components of a crawler, index, and ranker. The finished engine is designed to search the posts of the blogs you follow.
We also share several other articles and projects from the Python community, including a news roundup, how a Polars query works under the hood, using Python for data analysis, understanding open-source licensing, summarizing the significant changes between Python versions, a robust TUI hex editor, and a lightweight dataframe library with a universal interface for data wrangling.
This week’s episode is brought to you by Intel.
Course Spotlight: Building Command Line Interfaces With argparse
In this step-by-step Python video course, you’ll learn how to take your command line Python scripts to the next level by adding a convenient command line interface that you can write with argparse.
Topics:
News:
uv
: Python Packaging in Rust – uv is an extremely fast Python package installer and resolver, designed as a drop-in alternative to pip and pip-tools. This post introduces you to uv and shows some of its performance numbers.Show Links:
Discussion:
Projects
Additional Links:
Level up your Python skills with our expert-led courses:
How do you avoid the bottlenecks of data processing systems? Is it possible to build tools that decouple storage and computation? This week on the show, creator of the pandas library Wes McKinney is here to discuss Apache Arrow, composable data systems, and community collaboration.
Wes briefly describes the humble beginnings of the pandas project in 2008 and moving the project to open source in 2011. Since then, he’s been thinking about improvements across the data processing ecosystem.
Wes collaborated with members of the broader data science community to build the in-memory analytics infrastructure of Apache Arrow. Arrow avoids the bottlenecks of repeated data serialization and format conversion. He shares examples of Arrow’s use across the spectrum in tools like Polars and DuckDB.
Wes advocates moving from vertically integrated tools toward composable data systems. We discuss his work on Ibis, a portable dataframe API for data manipulation and exploration in Python. Ibis supports multiple backends by decoupling the API from the execution engine.
This week’s episode is brought to you by Posit Connect.
Course Spotlight: Unleashing the Power of the Console With Rich
Rich is a powerful library for creating text-based user interfaces (TUIs) in Python. It enhances code readability by pretty-printing complex data structures and adds visual appeal with colored text, tables, animations, and more.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are real-life examples of using Python decorators? How can you harness their power in your code? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent article series that digs into Python decorators. The first two articles discuss the basics of constructing decorators. The third part describes how popular Python libraries use decorators with call interception, function registration, and enriching the behavior of a function.
Christopher shares a piece about the common pitfalls of working with the Pythondatetime
library. The article considers how current third-party libraries don’t address most of these quirks and offers a potential solution with a new library.
We also share several other articles and projects from the Python community, including a couple of news items, a discussion about the popularity of the Rust language, handling unset values in FastAPI with Pydantic, working with Python’s mini-language for formatting strings, mocking Django queryset functions, and a modern replacement for the Requests library.
This week’s episode is brought to you by Sentry.
Course Spotlight: Python Decorators 101
In this course on Python decorators, you’ll learn what they are and how to create and use them. Decorators provide a simple syntax for calling higher-order functions in Python. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it.
Topics:
datetime
PitfallsNews:
Show Links:
datetime
Pitfalls – It’s no secret that the Python datetime
library has its quirks. Not only are there probably more than you think, but third-party libraries don’t address most of them! Arie created a new library to explore what a better datetime
library could look like.None
so there is no way to distinguish between an explicit None
value and an unset field. This post explains how you process this scenario.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How do you manage the dependencies of a large-scale data science project? How do you migrate that project from a laptop to cloud infrastructure or utilize GPUs and multiple instances in parallel? This week on the show, Savin Goyal returns to discuss the updates to the open-source framework Metaflow.
Savin briefly describes the Metaflow platform and the goal of simplifying engineering overhead for data scientists and programmers. We discuss how the platform captures snapshots of a project as you work, allowing you to go back in time or share the state of your project with another team member.
We dig into the complicated process of managing dependencies for machine learning and data science projects. Savin describes how the required external libraries can be specified within a flow with the new @pypi
or @conda
decorators. This allows a project to scale from a local machine to the cloud or multiple instances with all dependencies included.
He talks about starting a new company, Outerbounds, with fellow co-workers from Netflix. Their vision is to continue to build the Metaflow open-source platform and offer customers scalable enterprise-grade infrastructure.
This week’s episode is brought to you by Intel.
Course Spotlight: Everyday Project Packaging With pyproject.toml
In this Code Conversation video course, you’ll learn how to package your everyday projects with pyproject.toml
. Playing on the same team as the import system means you can call your project from anywhere, ensure consistent imports, and have one file that’ll work for many build systems.
Topics:
@conda
and @pypi
decoratorsShow Links:
@pypi
Decorator - OuterboundsLevel up your Python skills with our expert-led courses:
What’s it like to sit down for your first developer sprint at a conference? How do you find an appropriate issue to work on as a new open-source contributor? This week on the show, author and software engineer Stefanie Molin is here to discuss starting to contribute to open-source projects.
Stefanie is a data scientist and software engineer on Bloomberg’s Security Data Science team. She recently wrote an article titled “5 Ways to Get Started in Open Source.” We discuss finding ways to contribute that fit your interests and developer skills. We dig into the experience of participating in community sprints at a conference.
Stefanie is the author of Hands-On Data Analysis with Pandas. We also discuss the different processes between writing technical articles and authoring a book.
This week’s episode is brought to you by Intel.
Course Spotlight: Documenting Python Projects With Sphinx and Read the Docs
In this video series, you’ll create project documentation from scratch using Sphinx, the de facto standard for Python. You’ll also hook your code repository up to Read The Docs to automatically build and publish your code documentation.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How does a debugger work? What can you learn about Python by building one from scratch? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a two-part tutorial on building a debugger in Python? Creating a simple one requires less code than you might think.
We also talk about an article from Itamar Turner-Trauring about how to prepare for the upcoming changes to NumPy. The new version is not backward compatible and will require some inspection of your project dependencies. Itamar includes advice, techniques, and tools for updating your code.
We also share several other articles and projects from the Python community, including a couple of news items, a discussion about managing advice as a new developer, moving to Python as a former R developer, building a Markov chain to generate readable nonsense, optimizing fonts to individual glyphs on your website, and a project for working with units of measurement in Python.
This week’s episode is brought to you by Posit Connect.
Course Spotlight: Create a Tic-Tac-Toe Python Game Engine With an AI Player
In this video course, you’ll create a universal game engine in Python for tic-tac-toe with two computer players, one of which will be an AI player using the powerful minimax algorithm. You’ll give your game library a text-based graphical interface and explore two front ends.
Topics:
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How can you measure the quality of a large language model? What tools can measure bias, toxicity, and truthfulness levels in a model using Python? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to discuss techniques and tools for evaluating LLMs With Python.
Jodie provides some background on large language models and how they can absorb vast amounts of information about the relationship between words using a type of neural network called a transformer. We discuss training datasets and the potential quality issues with crawling uncurated sources.
We dig into ways to measure levels of bias, toxicity, and hallucinations using Python. Jodie shares three benchmarking datasets and links to resources to get you started. We also discuss ways to augment models using agents or plugins, which can access search engine results or other authoritative sources.
This week’s episode is brought to you by Intel.
Course Spotlight: Learn Text Classification With Python and Keras
In this course, you’ll learn about Python text classification with Keras, working your way from a bag-of-words model with logistic regression to more advanced methods, such as convolutional neural networks. You’ll see how you can use pretrained word embeddings, and you’ll squeeze more performance out of your model through hyperparameter optimization.
Topics:
Background Links:
Dataset Links:
Tutorials and Documentation for Python Packages:
Measurement Links:
Training Data for LLMs:
Agents and Plugin Links:
Additional Links:
Level up your Python skills with our expert-led courses:
Do you need to transfer an extensive data collection for a science project? What’s the best way to send executable code over the wire for distributed processing? What are the different ways to serialize data in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a tutorial by Real Python author Bartosz Zaczyński called “Serialize Your Data With Python.” This comprehensive guide moves beyond XML and JSON to explore multiple data formats and their potential use cases. It’s a deep dive into the topic and provides a thorough resource for future reference.
We also discuss a Real Python tutorial about naming conventions in Python that use single and double underscores. The piece covers differentiating between public and non-public names in APIs, writing safe classes for subclassing purposes, and avoiding name clashes with keywords.
We also share several other articles and projects from the Python community, including a couple of release announcements and news items, a discussion about never being taught how to construct quality software, building a small REPL in Python, using the key
parameter in Python functions and methods, a framework for RESTful APIs using Flask and SQLAlchemy, and a Rust-based HTML sanitizer for your Python projects.
Course Spotlight: Writing Beautiful Pythonic Code With PEP 8
Learn how to write high-quality, readable code by using the Python style guidelines laid out in PEP 8. Following these guidelines helps you make a great impression when sharing your work with potential employers and collaborators. This course outlines the key guidelines laid out in PEP 8. It’s aimed at beginner to intermediate programmers.
Topics:
key
Parameter in PythonNews:
Show Links:
_
). You’ll learn how to use this character to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.key
Parameter in Python – A parameter named key
is present in several Python functions, such as sorted()
. This article explores what it is and how to use it.Discussion:
Projects:
Additional Links:
nh3
– Allowing users to input HTML in comments or blog posts is problematic and can lead to exploits on your site. For years, the Django community used django-bleach
, but since its deprecation, Adam has been using nh3
, a Rust-based HTML sanitizer.Level up your Python skills with our expert-led courses:
Are you interested in using your Python skills within Excel? Would you like to share a data science project or visualization as a single Office file? This week on the show, we speak with Principal Architect John Lam and Sr. Cloud Developer Advocate Sarah Kaiser from Microsoft about Python in Excel.
John shares the multi-year journey of adding Python to Excel. He describes how the project moved beyond writing user functions in Python to something much more elaborate. He details assembling a team with diverse skills in interface design, languages, and security.
Sarah discusses the instant convenience of having familiar Python and pandas techniques at your fingertips inside Excel. We cover typical data science workflows and the potential of interactive visualizations within a spreadsheet. We also share multiple resources for you to learn more.
Note: Python in Excel is currently a preview accessible by joining the Microsoft 365 Insider Program and selecting the Beta Channel.
Course Spotlight: Data Cleaning With pandas and NumPy
In this video course, you’ll learn how to clean up messy data using pandas and NumPy. You’ll become equipped to deal with a range of problems, such as missing values, inconsistent formatting, malformed records, and nonsensical outliers.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Three members of the Real Python team are joining us this week: Kate Finegan, Tappan Moore, and Philipp Acsany. We wanted to share a year-end wrap-up with tutorials, step-by-step projects, code conversations, and video courses that showcase what our team created this year.
Kate helps to shepherd articles through the multi-stage editing process. She and the rest of the team ensure these resources impart crucial Python knowledge and provide a thorough didactic experience. Kate was also instrumental in helping introduce a new group of tutorial authors to the Real Python editorial process and house style.
Philipp returns to the podcast after our conversation earlier this year, and it was great to talk to him about onboarding new video instructors. Tappan edits all our video courses and ensures that the sound, picture, and animations are just right. He also helped provide feedback to the new instructors on our video creation process.
We hope you enjoy this review! We look forward to bringing you another year full of great guests, articles, and topics.
Course Spotlight: Recursion in Python
A recursive function is one that calls itself. In this video course, you’ll see what recursion is, how it works in Python, and under what circumstances you should use it.
Topics:
Show Links:
Additional Links:
Level up your Python skills with our expert-led courses:
It’s been a fascinating year for the Python language and community. PyCoder’s Weekly included over 1,500 links to articles, blog posts, tutorials, and projects in 2023. Christopher Trudeau is back on the show this week to help wrap up everything by sharing some highlights and Python trends from across the year.
Christopher shares the top five links explored by PyCoder’s readers. We also dig into trends we noticed across all the articles and stories this year, including removing dead batteries from the standard library, continuing the effort to speed up Python, using Rust code in libraries, and moving away from microservices.
We hope you enjoy this review! We look forward to bringing you an upcoming year full of great Python news, articles, topics, and projects.
Course Spotlight: Python Basics: Building Systems With Classes
In this video course, you’ll learn how to work with classes to build complex systems in Python. By composing classes, inheriting from other classes, and overriding class behavior, you’ll harness the power of object-oriented programming (OOP).
Topics:
News:
Top Five PyCoder Links:
Topics and 2023 Trends:
pathlib
improvements, and a few other changes.Project:
Additional Links:
Level up your Python skills with our expert-led courses:
What goes into a code review in Python? Is there a difference in how a large organization practices code review compared to a smaller one? What do you do if you’re a solo developer? This week on the show, Brendan Maginnis and Nick Thapen from Sourcery return to talk about code review and automated code assistance.
Nick and Brendan discuss their personal experiences with code reviews. From working together at a large company to starting Sourcery as a pair of developers to growing a team, they’ve experienced how various organizations review code.
We discuss the importance of keeping code reviews positive and maintaining developer momentum. Nick and Brendan share techniques for automating organizational code rules and retaining institutional developer knowledge.
They’ve been busy developing new features for Sourcery, moving beyond the current refactoring features. Their team is leveraging LLMs to build an automated code assistant that can perform code reviews, write tests, and answer questions about your codebase. The goal is for it to act as a personalized computer pair programmer.
Course Spotlight: Using the bpython Enhanced REPL
In this video course, you’ll learn about bpython, an alternative Python REPL that brings code suggestions and many other IDE-like features to the terminal. Once you discover how much bpython can improve your productivity, you’ll never want to return to using the vanilla Python REPL again.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you thought of a way to improve the Python language? How do you share your idea with core developers and start a discussion in the Python community? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We consider a couple of Python syntax and functional ideas posted to the discussions on python.org. The first idea is for simplifying the syntax of a function’s keyword arguments, and the second is for the ability to return a NamedTuple
from a function. The threads reveal steps within the Python Enhancement Proposal (PEP) process and the goal of finding a sponsor.
Christopher covers a tutorial on building a JSON-like parser in Python. The project is a solid place to start if you want to learn about parsing and developing rules for recognizing syntax and extracting data.
We also share several other articles and projects from the Python community, including a couple of release announcements and news items, a step-by-step guide to building a hangman game for the command line in Python, the reasons why the Django admin is supposedly ugly and ways to customize it to differentiate admin environments, an explanation of confusing git terminology, a project to extract links from a remote HTML resource, and a regex crossword game.
Course Spotlight: Advent of Code: Solving Puzzles With Python
Advent of Code is an online advent calendar that shares new programming puzzles each day from December 1 to the 25. In this Code Conversation, you’ll learn why solving programming puzzles can be beneficial and how you can get started with Advent of Code using Python.
Topics:
NamedTuple
News:
Show Links:
Discussion:
Projects:
Additional Links:
namedtuple
– Real PythonLevel up your Python skills with our expert-led courses:
Has the current growth of artificial intelligence (AI) systems made you wonder what the future holds for Python developers? What are the hidden benefits of learning to program in Python and practicing computational thinking? This week on the show, we speak with author Lawrence Gray about his upcoming book “Mastering Python: A Problem Solving Approach.”
Lawrence shares how learning Python helped him through a dark and trying time. He developed lifelong skills that he wants to pass along through teaching and authoring a book.
We discuss what you can do to prepare for a future where coding jobs are automated through AI. He shares ways that Python can help build the higher-order thinking skills required by future careers. We also talk about how Python can help with computational thinking and promote cognitive development.
This week’s episode is brought to you by Site24x7.
Course Spotlight: Looping With Python enumerate()
Once you learn about for
loops in Python, you know that using an index to access items in a sequence isn’t very Pythonic. So what do you do when you need that index value? In this course, you’ll learn all about Python’s built-in enumerate()
, where it’s used, and how you can emulate its behavior.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you moved through the fundamentals of Python, and are you now considering building a more extensive project or complete application? Where can you study the architecture of existing Python projects and learn best practices? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a set of resources that developers can study to learn how to structure projects. The collection was shared in a blog post titled “Great Resources a Beginner Might Not Find So Easily.” It includes a pair of books on the architecture of large software applications and another aimed at more modest projects.
We consider when you should use lambda expressions in your Python code. These one-line expressions create anonymous functions. How do they differ from standard functions, and where is it appropriate to use them?
We also share several other articles and projects from the Python community, including a couple of release announcements, an explanation of Python as a compiled language, a discussion covering the controversy about the recent Flask release, a project for writing less Selenium code, and a project to create ASCII art with Python.
This week’s episode is brought to you by Site24x7.
Course Spotlight: Design and Guidance: Object-Oriented Programming in Python
In this video course, you’ll learn about the SOLID principles, which are five well-established standards for improving your object-oriented design in Python. By applying these principles, you can create object-oriented code that is more maintainable, extensible, scalable, and testable.
Topics:
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you getting by with a few fundamental commands for Git when building your Python projects? Would you like to improve your version control techniques and become more efficient with the Git command line? This week on the show, Adam Johnson is back to talk about his new book, “Boost Your Git DX.”
Adam brings advice about creating a Git configuration, enabling autocorrect, and customizing a global ignore file. He combed through the cryptic documentation and found the valuable developer settings, so you won’t have to.
Adam also shares tools and settings to speed up your terminal workflows. We discuss configuring Zsh, creating aliases, and comparing diffs. We briefly dig into the most recent update to Django and his work on the project.
This week’s episode is brought to you by Taipy.
Course Spotlight: Introduction to Git and GitHub for Python Developers
What is Git, what is GitHub, and what’s the difference? Learn the basics of Git and GitHub from the perspective of a Pythonista in this step-by-step video course.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you prepare a scientific Python project for sharing with others? Could you use some best practices and guidance for packaging, documentation, and testing? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We talk about the creation of the Scientific Python Library Development Guide. The guide was finalized during the 2023 Scientific Python Developer Summit and is a resource for modern packaging. It includes sections of tutorials, principles, templates, and common patterns.
Christopher shares a recent Real Python tutorial about sorting Unicode strings in Python. He covers some of the pitfalls and ways to avoid them. The tutorial includes multiple third-party libraries to assist in wrangling Unicode characters.
We also share several other articles and projects from the Python community, including a couple of release announcements, information on namespaces and variable scope in Python, benchmark comparisons of Numba and Mojo, a discussion of recent so-called AI fails, a TUI for log files with a merged timeline, a cross-platform GUI building tool similar to HyperCard, and a project for reproducing exact argparse
arguments.
Course Spotlight: Exploring Scopes and Closures in Python
In this Code Conversation video course, you’ll take a deep dive into how scopes and closures work in Python. To do this, you’ll use a debugger to walk through some sample code, and then you’ll take a peek under the hood to see how Python holds variables internally.
Topics:
logmerger
: TUI for Log Files With Merged Timelinereverse_argparse
: Tell the User What They RanNews:
Show Links:
Discussion:
Projects:
logmerger
: TUI for Log Files With Merged Timelinereverse_argparse
: Tell the User What They RanAdditional Links:
Level up your Python skills with our expert-led courses:
You may remember a recent Python Package Index (PyPI) announcement about hiring a full-time security engineer. We’ve also mentioned several current security initiatives from PyPI. This week on the show, we talk with Mike Fiedler about accepting this new role and securing accounts on PyPI.
Mike talks about how he started as a contributor to PyPI and eventually became a maintainer. We dig into why he fits this new role well and what his responsibilities are.
We discuss the initiative to secure accounts using two-factor authentication (2FA) methods. Mike also explains how package maintainers can adopt a new, more secure publishing method called trusted publishing that doesn’t require long-lived passwords.
We also discuss Mike’s recent talk called “How to Give Back to Open Source Without Losing Your Mind.” Mike shares advice and resources for finding your own contribution entry points.
Course Spotlight: Publishing Python Packages to PyPI
In this video course, you’ll learn how to create a Python package for your project and how to publish it to PyPI, the Python Package Index. Quickly get up to speed on everything from naming your package to configuring it using setup.cfg
.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What fundamental developer skills are new Python users missing? What best practices might developers without a computer science background be lacking? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher opens our discussion by sharing a recent social media thread about teaching software engineering best practices to scientists and others without a computer science background. We talk about software design philosophy and strategies for sharing knowledge within an organization.
We cover the results from the sixth annual official Python Developer Survey. The survey covers Python usage, language versions, frameworks, libraries, and various demographics. We dig into the details and share our insights.
We also share several other articles and projects from the Python community, including a couple of release announcements, so many Python dataframes, ways to speed up your code when multiple cores aren’t an option, Python’s syntactic sugar, a computer algebra system named SymPy, the process of building a blog in Django, code metrics in Python with Radon, and a TUI app for daily writing.
This week’s episode is brought to you by Snyk.
Course Spotlight: Filtering Iterables With Python
In this video course, you’ll learn how Python’s filter()
works and how to use it effectively in your programs. You’ll also learn how to use list comprehension and generator expressions to replace filter()
and make your code more Pythonic.
Topics:
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Python 3.12 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to discuss the new version. Geir Arne coordinated a series of preview articles with several members of the Real Python team this year, and his showcase tutorial, “Python 3.12: Cool New Features for You to Try,” came out on October 2. Christopher’s video course was posted the next day, covering the topics from the article with visual examples of Python 3.12 in action.
Geir Arne and Christopher collaborated to create code examples of the new features. We discuss better error messaging, more intuitive f-strings, subinterpreters, the Linux perf
profiler, improved typing syntax, and more.
We dig into the updates and offer advice on incorporating them into your projects. We also consider when you should start running Python 3.12.
Course Spotlight: What’s New in Python 3.12
In this video course, you’ll explore the new features that Python 3.12 brings to the table. These include improved f-strings, better error messages, changes to CPython internals, additions to static typing, and more.
Topics:
perf
profileritertools.batched()
for grouping ItemsPath.walk()
for listing files in subdirectoriesShow Links:
Level up your Python skills with our expert-led courses:
What can you learn from feeding an entire book on Python programming into ChatGPT-4 and asking it to provide a technical review? What are the potential pitfalls of using an LLM as a learning tool? This week on the show, author Al Sweigart talks about his recent experiments using ChatGPT and Python.
Al wanted to test how well an LLM could understand the computer science concepts covered in his recent book, The Recursive Book of Recursion. We talk about the positive and negative results of this technical review. We consider if this would be a valuable tool for technical review of your projects.
Al shares his thoughts on using ChatGPT as a learning tool and its potential pitfalls. We also cover the current strengths of this type of tool for Python developers.
Course Spotlight: Python Basics Exercises: Conditional Logic and Control Flow
In this Python Basics Exercises course, you’ll review how to use conditional logic to write programs that perform different actions based on different conditions. Paired with functions and loops, conditional logic allows you to write complex programs that can handle many different situations.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you thought about contributing to an open-source Python project? What are possible entry points for intermediate developers? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent article by Stefanie Molin called “5 Ways to Get Started in Open Source.” Christopher shares his experience with suggesting features and potential bug fixes. We talk about common entry points for beginners and provide additional resources.
We cover a recent Real Python tutorial about creating QR codes with Python. The tutorial introduces the library Segno and tours the features. By working through the examples, you’ll be ready to build a QR code project yourself.
We also cover several other articles and projects from the Python community, including a couple of release announcements, an introduction to Python’s functools
module, Hatch as an alternative for packaging, options for when NumPy is too slow, a simple diceware generator project, and a collection of machine learning recipes.
Course Spotlight: Caching in Python With lru_cache
Caching is an essential optimization technique. In this video course, you’ll learn how to use Python’s @lru_cache
decorator to cache the results of your functions using the LRU cache strategy. This is a powerful technique you can use to leverage the power of caching in your implementations.
Topics:
News:
Show Links:
functools
module with real-world examples to help show you how and when to use each feature.Discussion:
Projects:
Additional Links:
functools
— Higher-order functions and operations on callable objects — Python documentationLevel up your Python skills with our expert-led courses:
When choosing a tool for profiling Python code performance, should it focus on the CPU, GPU, memory, or individual lines of code? What if it looked at all those factors and didn’t alter code performance while measuring it? This week on the show, we talk about Scalene with Emery Berger, Professor of Computer Science at the University of Massachusetts Amherst.
Emery talks about his background in memory management and his collaboration on Hoard, a scalable memory manager system used in Mac OS X. We discuss the need for improving code performance on modern computer architecture. He highlights this idea by contrasting the familiar limitations of Moore’s law with the lesser-known rule of Dennard scaling.
Working with his students in the university lab, they developed Scalene. Scalene is a high-performance CPU, GPU, and memory profiler. It can look at code from the individual function or line-by-line level and compare time spent in Python vs C code. Emery talks about the recent Scalene feature of AI-powered optimization proposals and covers a couple of examples. He also shares a collection of additional Python code-assistant tools from their lab.
Course Spotlight: What Does if name == “main” Mean in Python?
In this video course, you’ll learn all about Python’s name-main idiom. You’ll learn what it does in Python, how it works, when to use it, when to avoid it, and how to refer to it.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Are you writing efficient Python with as few lines of code as possible? Are you familiar with the many built-in language features that will simplify your code and make it more Pythonic? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent post from Bob Belderbos titled “Make Each Line Count, Keeping Things Simple in Python.” We provide many of our favorite Pythonic examples and the language mistakes that we’ve learned from. We also share multiple resources to add to your learning path.
Microsoft has announced a limited beta program for Python in Excel. We dig into the current details, requirements, and potential use cases.
We cover several other articles and projects from the Python community, including a group of announcements from the Python Software Foundation, a showcase of the Polars DataFrame library, immortal objects in Python, a code image generator Python project, an MS Paint clone in the terminal, and a Django ORM cheatsheet.
Course Spotlight: Process Images Using the Pillow Library and Python
In this video course, you’ll learn how to use the Python Pillow library to deal with images and perform image processing. You’ll also explore using NumPy for further processing, including to create animations.
Topics:
News:
Show Links:
Discussion:
enumerate()
: Simplify Loops That Need Counters – Real Pythonall()
: Check Your Iterables for Truthiness – Real Pythonany()
in Python – Real PythonProjects:
Additional Links:
Level up your Python skills with our expert-led courses:
What should you consider when picking a font for coding in Python? What characters and their respective glyphs should you check before making your decision? This week on the show, we talk with Real Python author and core team member Philipp Acsany about his recent article, Choosing the Best Coding Font for Programming.
Philipp shares some of his background as a font engineer and graphic designer. We talk about how font design tools were his introduction to programming in Python.
We discuss how the frequent use of underscores, at signs, parentheses, and asterisks in Python’s syntax should affect your decision. Philipp’s tutorial provides several resources to help you find a monospace font that fits your coding requirements.
Course Spotlight: Create a Python Wordle Clone With Rich
In this step-by-step project, you’ll build your own Wordle clone with Python. Your game will run in the terminal, and you’ll use Rich to ensure your word-guessing app looks good. Learn how to build a command-line application from scratch and then challenge your friends to a wordly competition!
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How can you improve a classification model while avoiding overfitting? Once you have a model, what tools can you use to explain it to others? This week on the show, we talk with author and Python trainer Matt Harrison about his new book Effective XGBoost: Tuning, Understanding, and Deploying Classification Models.
Matt talks about the process of developing the book and how he wanted it to be an interactive experience for the reader. He explains the concept of gradient boosting and provides metaphors for developing a model. He shares his appreciation for exploratory data analysis as a crucial step in understanding your data.
He also shares additional libraries to help you explain your model. We discuss how difficult it is to develop the story of how the model works to share it with stakeholders.
He illustrates why covering the complete process is essential, from exploring data and building a model to finally deploying it. He shares many of the tools he found along the way.
This week’s episode is brought to you by Scout APM.
Course Spotlight: Starting With Linear Regression in Python
In this video course, you’ll get started with linear regression in Python. Linear regression is one of the fundamental statistical and machine learning techniques, and Python is a popular choice for machine learning.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you ever encountered strange behavior when trying something new in Python? What are common quirks hiding within the language? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent blog post that lists a collection of quirky Python behaviors. We share a few examples with explanations but leave several as puzzles to dig into.
Christopher transitions our discussion into Python features that can be difficult to explain to a new programmer. We also share some of our own stumbling blocks while learning the language.
We cover several other articles and projects from the Python community, including a news update, previewing Python 3.12’s more intuitive and consistent f-strings, finding performance bottlenecks with profiling, emulating the 6502 processor in Python, using Rich to inspect Python objects, and plotting statistical data with Lets-Plot.
This week’s episode is brought to you by Porkbun.
Course Spotlight: Graph Your Data With Python and ggplot
In this course, you’ll learn how to use ggplot in Python to build data visualizations with plotnine. You’ll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way.
Topics:
News:
Show Links:
Discussion
Projects:
inspect
feature, which gives you loads of information on an object.Additional Links:
Level up your Python skills with our expert-led courses:
What are the new ways to describe your data in pandas 2.0? Will the addition of Apache Arrow to the data back end foster the growth of data interoperability? This week on the show, we talk with pandas core developer Marc Garcia about the release of pandas 2.0.
Marc shares his background and work on pandas. We discuss the history of data representation in pandas and the need to move beyond NumPy. We also talk about how Apache Arrow only solves some of the issues.
We dig into the potential of an Apache Arrow back end and how it could offer interoperability between data platforms. We also cover the moderate adoption and backward-compatibility concerns. Marc also shares his thoughts on making pandas more extensible.
Course Spotlight: The pandas DataFrame: Working With Data Efficiently
In this course, you’ll get started with pandas DataFrames, which are powerful and widely used two-dimensional data structures. You’ll learn how to perform basic operations with data, handle missing values, work with time-series data, and visualize data from a pandas DataFrame.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are all the different versions of Python? You may have heard of Cython, Brython, PyPy, or others and wondered where they fit into the Python landscape. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares an article from the Bite Code blog about all the different forms that Python can take. CPython is the reference implementation of the language, which is what we usually discuss. He lists several alternative projects and the use cases.
We also discuss a recent Real Python tutorial about IPython. IPython is an interactive Python shell from the team that developed Jupyter Notebooks. It includes a set of IDE-like features and unique magic commands. The tutorial digs into using the tool to learn more about Python and explore your code.
We cover several other articles and projects from the Python community, including several news updates, the state of WASI support for CPython, how Python uses garbage collection, a discussion about the current AI echo chamber, an async Python web microframework, a stand-alone CSV editor, and a project for identifying unused dependencies to avoid a bloated virtual environment.
This week’s episode is brought to you by Scout APM.
Course Spotlight: Mazes in Python Part 1: Building and Visualizing
In this two-part video course project, you’ll build a maze solver in Python using graph algorithms from the NetworkX library. Along the way, you’ll design a binary file format for the maze, represent it in an object-oriented way, and visualize the solution using scalable vector graphics (SVG).
Topics:
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you getting the most out of your Postgres database? What features could you leverage to improve your Python project? This week on the show, Craig Kerstiens from Crunchy Data is here to discuss getting the most out of Postgres.
Craig shares his years of PostgreSQL expertise with advice on getting more from the platform. We talk about rich data types for describing ranges, geospatial data, and JSON.
Craig shares tools for accessing performance statistics from the command line and strategies for optimizing your terminal settings for SQL searches. He discusses Postgres extensions for customizing the database to your needs. Craig also provides multiple resources for learning more and an online tool for practicing within a playground environment.
Course Spotlight: Creating Web Maps From Your Data With Python Folium
You’ll learn how to create web maps from data using Folium. The package combines Python’s data-wrangling strengths with the data-visualization power of the JavaScript library Leaflet. In this video course, you’ll create and style a choropleth world map showing the ecological footprint per country.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What principles should you consider when designing a Python library? How do you construct a library API that’s understandable and easy to use? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We share an article about building library APIs. The piece provides advice for package structure, naming, error handling, and more. The author guides you toward Pythonic principles by comparing clunky vs elegant design examples.
Christopher discusses his recent video course on Jinja templating. The course covers creating text files with programmatic content and employing rich templates to structure the front end of Python web applications.
We cover several other articles and projects from the Python community, including several news updates, reasons why membership tests are fast for the range()
function, CLI tools hidden in the Python standard library, a thread about the right way to install Python, recipes for using the Polars library, and a project for feature flags within Django.
This week’s episode is brought to you by Snyk.
Course Spotlight: Jinja Templating
With Jinja, you can build rich templates that power the front end of your web applications. But you can use Jinja without a web framework running in the background. Anytime you want to create text files with programmatic content, Jinja can help you out.
Topics:
bdist_egg
Uploads to PyPIrange()
in Python?News:
bdist_egg
Uploads to PyPI – PEP 715 has been accepted and as of August 1, 2023, the .egg
format will no longer be accepted as an upload. Existing eggs on PyPI will remain in place.Show Links:
range()
in Python? – In Python, range()
is most commonly used in for
loops. However, ranges have some other use cases too, as they share many properties with lists. In this tutorial, you’ll explore why it’s so fast to perform a membership test on a Python range.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How much Python do you need to learn to start creating projects? What’s a good balance of information and hands-on practice? This week on the show, Eric Matthes is here to discuss his book Python Crash Course.
As a former high school science, math, and programming teacher, Eric saw something missing in the programming publishing landscape. We discuss the guiding questions that inspired the book’s development and the title. Eric covers how the crash course takes readers through a fast-paced introduction to Python that culminates in three unique projects.
We also discuss Eric’s blog, Mostly Python, where he digs deeper into technical subjects. He also occasionally shares more topical posts and includes many exercises.
Course Spotlight: Plot With pandas: Python Data Visualization Basics
In this course, you’ll get to know the basic plotting possibilities that Python provides in the popular data analysis library pandas. You’ll learn about the different kinds of plots that pandas offers, how to use them for data exploration, and which types of plots are best for certain use cases.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What advice can you extract from the Zen of Python? How can these nineteen guiding principles help you write more idiomatic Python? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a Real Python tutorial by Bartosz Zaczyński titled “What’s the Zen of Python?” We talk about the poem’s origin and ways to access the Zen within Python. We also discuss how different sections provide contradictory advice for what makes good Python code.
We cover a recent post by previous guest Matt Harrison about using Python and pandas for finance. Matt’s article covers methods in the pandas library for aggregation, resampling, and rolling averages.
We cover several other articles and projects from the Python community, including staying up-to-date with news, solving a Legend of Zelda puzzle with Python, avoiding “simply” providing advice, displaying better stack traces, and creating files with fake data.
Course Spotlight: Speed Up Python With Concurrency
Learn what concurrency means in Python and why you might want to use it. You’ll see a simple, non-concurrent approach and then look into why you’d want threading, asyncio, or multiprocessing.
Topics:
.readthedocs.yaml
ConfigurationNews:
.readthedocs.yaml
Configuration – The Read the Docs site has announced the new requirement that all builds must move to using a .readthedocs.yaml
configuration file, version 2. There are some test windows where they’ll be temporarily enforcing the change, but the final release date is September 25, 2023. Read on for details on how to migrate your project.Topic Links:
pip
is often the better choice.Discussion:
asyncio
? In this opinion piece, he talks about why he doesn’t like asyncio
and which alternatives he prefers.Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you looking to advance your CircuitPython projects? Would you like a collection of resources and tools to help you along your path? This week on the show, Tod Kurt is here to discuss building projects with CircuitPython.
Tod has been working with embedded electronics for a long time and has been an active member of the Arduino community. He recently started to build projects using CircuitPython, and it has become his preferred prototype method.
He shares software resources, hardware tools, and advice about working with CircuitPython and embedded electronics. We discuss several of his music hardware projects and the libraries and modules that he uses for synthesis. He also shares a powerful online prototyping tool to plan your project before spending money or plugging in a soldering iron.
Course Spotlight: Python Basics: Reading and Writing Files
In this video course, you’ll learn how to move data back and forth between your Python programs and external software by reading and writing files. You’ll practice reading and writing data stored in the CSV file format, one of the most widely supported file formats for transferring tabular data.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are the unique challenges of a large Python code base? What techniques can you implement to simplify the management of a big project? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent thread on Hacker News about working with a large Python code base. Christopher advises configuring tests and using tools to keep your code consistent across an organization. He also answers several questions about code complexity, typing, and leveraging third-party libraries.
We cover several other articles and projects from the Python community, including news from the Python Language Summit, Kivy for GUI development, the power of bit manipulation, the removal of unused import statements in your code, and a Python-based iOS project for adding reminders about links from a podcast.
Course Spotlight: Build Cross-Platform GUI Apps With Kivy
In this video course, you’ll learn how to build a cross-platform mobile application with Python and the Kivy GUI framework. You’ll discover how to develop an application that can run on your desktop as well as your phone. Then, you’ll package your app for Windows, Linux, and macOS.
Topics:
.__call__()
Method: Creating Callable InstancesShow Links:
.__call__()
Method: Creating Callable Instances – In this tutorial, you’ll learn what a callable is in Python and how to create callable instances using the .__call__()
special method in your custom classes. You’ll also code several examples of practical use cases for callable instances in Python.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you thought about getting more involved in the Python community? Are you interested in volunteering for an event or becoming an organizer? This week on the show, we speak with organizers from this year’s PyCascades conference about making connections, learning new skills, and rationing your time.
We have three guests to discuss working on PyCascades 2023 and how they got involved in volunteering. Conference Chair Ben Berry, a site reliability engineer based in Seattle, is currently working on a private platform-as-a-service. Diversity Chair Madison Swain-Bowden is a senior data engineer out of Seattle, currently working at Automattic on the Openverse team. Sponsorship Chair Michael van der Kamp is a back-end engineer at Coffee Meets Bagel.
We discuss finding other volunteers, maintaining motivation, and connecting with sponsors. Our guests also share their stories of overcoming challenges, connecting with community, and finding fulfillment through volunteering.
This week’s episode is brought to you by Proxify.
Course Spotlight: Using pandas to Make a Gradebook in Python
With this course and Python project, you’ll build a script to calculate grades for a class using pandas. The script will quickly and accurately calculate grades from a variety of data sources. You’ll see examples of loading, merging, and saving data with pandas, as well as plotting some summary statistics.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Do you need a refresher on using Docker with Python? Would you like to learn how to configure a continuous integration pipeline with modern tools and Docker? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We share a Real Python tutorial from Bartosz Zaczyński about building continuous integration with Docker. Docker provides consistent environments for configuring, testing, and delivering Python applications. In this tutorial, you’ll get up to speed with current Docker and CI techniques.
We also speak with Bill Pollock from No Starch Press about Hacker Initiative. The public nonprofit gives back to and strengthens the hacking community. The 2023 grant cycle is currently open until August 15. We discuss the application process and projects from previous grant recipients.
We cover several other articles and projects from the Python community, including a news update and some resources on implementing metaclasses in Python, creating time machine-style backups, and scanning your project for vulnerabilities.
Course Spotlight: Metaclasses in Python
Metaclasses are an important but mysterious behind-the-scenes mechanism for instantiating classes in Python. In this video course, you’ll learn how Python’s metaclasses work in object-oriented programming.
Topics:
News:
Show Links:
Projects:
Hacker Initiative Links:
Additional Links:
Level up your Python skills with our expert-led courses:
Would you like to speed up your Python machine-learning code dramatically? What if you only had to change a few keywords and add a couple of type hints on portions of your code? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a new programming language named Mojo, which is a superset of Python. It aims to fix Python’s performance and deployment problems. The project has many interesting ideas and a leader who has helped to shape modern compiler technology.
We also share a pair of Real Python tutorials from Leodanis Pozo Ramos about object-oriented programming in Python. The first one is a deep dive into the creation of classes. It’s an excellent refresher for anyone looking to hone their OOP skills in Python.
The second tutorial covers the SOLID principles, which are five well-established standards for improving your object-oriented design. These principles guide you to create object-oriented code that is more maintainable, extensible, scalable, and testable.
We cover several other articles and projects from the Python community, including a news update, showing warnings when running Django, tracking the progress of your Python program, and a Markdown browser for your terminal.
This week’s episode is brought to you by Koyeb.
Course Spotlight: Using k-Nearest Neighbors (kNN) in Python
In this video course, you’ll learn all about the k-nearest neighbors (kNN) algorithm in Python, including how to implement kNN from scratch. Once you understand how kNN works, you’ll use scikit-learn to facilitate your coding process.
Topics:
dataclasses.field
News:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How do Python virtual environments work under the hood? How does understanding these concepts help you with managing them for your projects? This week on the show, CPython core developer Brett Cannon returns to discuss his recent articles about virtual environments and the Python packaging landscape.
Brett talks about his recent article “How Virtual Environments Work.” He was researching the topic to solve an issue with a Linux Python distribution that doesn’t provide the tools to create virtual environments. We talk about how he solved the problem by creating a tiny library named microvenv.
We also take a look at the Python packaging ecosystem. Brett talks about the early days of Python, when these tools didn’t exist. He contrasts that with the current packaging solution explosion and how each one attempts to solve unique problems. We also discuss the Python Packaging User Survey and the plans for packaging summits at PyCon US. Note that we recorded this episode two weeks before PyCon US 2023.
Course Spotlight: Getting the Most Out of the Python Standard REPL
In this video course, you’ll learn how to use the Python standard REPL (Read-Eval-Print Loop) to run your code interactively. This tool will allow you to test new ideas, explore and experiment with new tools and libraries, refactor and debug your code, try out examples, and more.
Topics:
pip
Show Links:
Level up your Python skills with our expert-led courses:
How can you ensure that you’ve appropriately declared your project’s required dependencies? How do you determine what dependencies are missing from a third-party project that you can’t run? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a new Python dependency checker called FawltyDeps. The tool helps you determine if you’ve declared too few or too many packages for your project.
Christopher has brought several developer resource collections: a list of assured open-source Python packages from Google, test databases with interesting datasets, and multiple Django third-party packages.
We cover several other articles and projects from the Python community, including a news update, advice on how to pitch yourself as a guest to a podcast, how to submit articles and projects to PyCoders Weekly, PyPI’s introduction of trusted publishers and organizations, a tool for tracking package history, a pixel art paint program written in Python, and a project for efficient string matching with regular expressions.
Course Spotlight: Publishing Python Packages to PyPI
In this video course, you’ll learn how to create a Python package for your project and how to publish it to PyPI, the Python Package Index. Quickly get up to speed on everything from naming your package to configuring it using setup.cfg
.
Topics:
News:
Show Links:
Projects
Additional Links:
Level up your Python skills with our expert-led courses:
Are you familiar with the different versions of WebAssembly? Could WASM be the “write once, run everywhere” solution that developers have searched for? Where does distributing Python applications fit in the narrative? This week on the show, we have CPython core developer Brett Cannon to discuss his recent articles about WebAssembly and MVPy.
Brett has completed his syntactic sugar series, which we discussed in a previous episode. He details the origin of the series and his process of unearthing a minimum viable version of Python. Brett shares how he updated his PyCon US talk on the subject after feedback from presenting it at PyCascades.
We also dig deep into WebAssembly, specifically WebAssembly System Interface (WASI). Brett explains the concept of a “platform target triple” and the importance of defining which system CPython is compiled for. We also discuss WebAssembly becoming a ubiquitous distribution system.
Course Spotlight: Python Basics: Building Systems With Classes
In this video course, you’ll learn how to work with classes to build complex systems in Python. By composing classes, inheriting from other classes, and overriding class behavior, you’ll harness the power of object-oriented programming (OOP).
Topics:
Show Links:
pytest
Level up your Python skills with our expert-led courses:
What can you do if your text manipulation in Python is slowing you down? Are there faster alternatives using a compiled extension? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a recent article by Itamar Turner-Trauring called “Speeding Up Text Processing in Python (Is Hard).” The piece compares the performance of string-matching scenarios using several alternatives to pure Python that rely on compiled extensions.
We also discuss a recent Real Python tutorial by Stephen Gruppetta on when to use .__repr__()
vs .__str__()
in Python. We cover the use cases for these special methods and the intended audiences for the strings they produce.
We share several other articles and projects from the Python community, including a news update, an article on the functional power of Python’s reduce()
, a call to ban 1+N in Django, a friendly project to fetch your data files, and a tool for tracking your work from the shell.
Course Spotlight: Unicode in Python: Working With Character Encodings
In this course, you’ll get a Python-centric introduction to character encodings and Unicode. Handling character encodings and numbering systems can at times seem painful and complicated, but this guide is here to help with easy-to-follow Python examples.
Topics:
.__repr__()
vs .__str__()
in Python?reduce()
- The Power of a Single Python FunctionNews:
Show Links:
.__repr__()
vs .__str__()
in Python? – In this tutorial, you’ll learn the difference between the string representations returned by .__repr__()
vs .__str__()
and understand how to use them effectively in classes that you define.reduce()
- The Power of a Single Python Function – “While Python is not a pure functional programming language, you still can do a lot of functional programming in it. In fact, just one function - reduce()
- can do most of it.” This article introduces you to reduce()
.Projects:
Additional Links:
reduce()
: From Functional to Pythonic Style – Real PythonLevel up your Python skills with our expert-led courses:
Are you exploring automation of your repetitive business tasks with Python? How are you going to share your helpful tools with co-workers? This week on the show, Sampo Ahokas from Robocorp is here to discuss robotic process automation (RPA) and distribution of these robots.
Sampo is a co-founder and VP of engineering at Robocorp. We talk about using Robot Framework, an open-source RPA tool, to develop bots that implement your existing Python skills. Sampo shares example projects and additional resources for new users.
We discuss the typical difficulties of sharing automation tools with a team and trying to avoid the dreaded “works on my machine” problem. Sampo describes how their group worked to develop a Conda-based tool for creating shareable packages and environments.
Course Spotlight: Manipulating ZIP Files With Python
In this video course, you’ll learn how to manipulate ZIP files using Python’s zipfile
module from the standard library. Through hands-on examples, you’ll learn how to read, write, compress, and extract files from your ZIP files quickly.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you ever installed a Python package without knowing anything about it? What best practices should you employ to ensure the quality of your next package installation? Christopher Trudeau is back this week, bringing another batch of PyCoder’s Weekly articles and projects. We also have Python Software Foundation executive director, Deb Nicholson, to share details about PyCon US 2023.
We cover a recent Real Python tutorial by Philipp Acsany on evaluating the quality of Python packages. The piece provides a tool kit for researching the traits, history, software license, and current condition of external Python packages. We also discuss the techniques that we personally use before selecting a package for our Python projects.
We share several other articles and projects from the Python community, with topics such as the underlying structure of virtual environments, the overhead of Python asyncio
tasks, documentation for Python projects with Sphinx and Read the Docs, a project for creating argparse
boilerplate, and a way to generate seemingly realistic fake numbers using Benford’s law.
Deb Nicholson is also here to talk about the 20th anniversary of PyCon US, hosted in Salt Lake City. We dig into the details of the upcoming conference, including keynote speakers, tutorials, scheduled talks, and improvements to the hybrid online experience.
Course Spotlight: Documenting Python Projects With Sphinx and Read the Docs
In this video series, you’ll create project documentation from scratch using Sphinx, the de facto standard for Python. You’ll also hook your code repository up to Read The Docs to automatically build and publish your code documentation.
Topics:
asyncio
Tasksargparse
BoilerplateShow Links:
microvenv
.Projects:
argparse
BoilerplatePyCon US 2023 Links:
Additional Links:
Level up your Python skills with our expert-led courses:
What are the core lessons you’ve learned along your Python development journey? What are key takeaways you would share with new users of the language? This week on the show, Duarte Oliveira e Carmo is here to discuss his recent talk, “Four Years of Python.”
Duarte works at the crossroads of machine learning, data science, and software engineering. He began using Python in his graduate studies and never looked back. In 2021, he wrote a blog post about some of the valuable lessons he’s learned. Then he decided the lessons and concepts in the post might make a good conference talk.
We cover the steps in his process of crafting the presentation, practicing it at a smaller conference, and finally presenting it at PyCon Italia last year. We also dig into the four major themes of the talk. Along the way, we share a collection of resources to help you continue learning on your Python journey.
Course Spotlight: Building a URL Shortener With FastAPI and Python
In this video course, you’ll build an app to create and manage shortened URLs. Your Python URL shortener can receive a full target URL and return a shortened URL. You’ll also use the automatically created documentation of FastAPI to try out your API endpoints.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you explored Python’s collections module? Within it, you’ll find a powerful factory function called namedtuple(), which provides multiple enhancements over the standard tuple for writing clearer and cleaner code. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher discusses his Real Python video course about writing more Pythonic code using namedtuple()
. With namedtuple(), you can create immutable sequence types that allow you to access their values using descriptive field names and dot notation instead of clunky integer indices.
We also discuss metaprogramming and the unique advantages of Python’s dynamism. Christopher shares potential paths for this type of coding from web applications, testing, and AST techniques.
We share several other articles and projects from the Python community, including a news update, the Arrow revolution happening in pandas 2.0, a new PEP for inlined comprehensions, tips and techniques for modern Flask apps, a Python helper tool for building and running a REPL with custom commands, and a project to turn a pandas DataFrame into a Tableau-style UI.
Course Spotlight: Writing Clean, Pythonic Code With namedtuple
In this video course, you’ll learn what Python’s namedtuple
is and how to use it in your code. You’ll also learn about the main differences between named tuples and other data structures, such as dictionaries, data classes, and typed named tuples.
Topics:
namedtuple
News:
Show Links:
namedtuple
– In this video course, you’ll learn what Python’s namedtuple
is and how to use it in your code. You’ll also learn about the main differences between named tuples and other data structures, such as dictionaries, data classes, and typed named tuples.list
, dict
, and set
comprehensions as inline code can result in a 2x speedup on the comprehension.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you interested in deploying your Python project everywhere? This week on the show, Russell Keith-Magee, founder and maintainer of the BeeWare project, returns. Russell shares recent updates to Briefcase, a tool that converts a Python application into native installers on macOS, Windows, Linux, and mobile devices.
We cover how Anaconda hired him last year to work full-time on the BeeWare project. He shares how this has helped him focus his efforts and move the project forward.
We also discuss his recent talk at DjangoCon US 2022 on how to turn your website into an app (and why maybe you shouldn’t). Russell details the problems of converting from the Web to a mobile platform. We also contrast WebAssembly System Interface (WASI) with the tools that his team works on.
Course Spotlight: Managing Attributes With Python’s property()
In this video course, you’ll learn how to create managed attributes, also known as properties, using Python’s property()
in your custom classes.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you decided how you’re going to deploy your Django project? Should you use a VPS or a PaaS? Christopher Trudeau is back this week, bringing another batch of PyCoder’s Weekly articles and projects. We also have organizers from PyCascades to share details about this year’s hybrid in-person and virtual conference.
Christopher shares an article about selecting an appropriate Django project deployment strategy. The guide compares VPS (virtual private server) and PaaS (platform as a service) systems. He also covers hosting providers for each and highlights potential pitfalls.
We share several other articles and projects from the Python community, including a news update, what’s new in SQLAlchemy 2.0, how to flush the output of the Python print function, the dangers behind image resizing for machine learning, a project that visualizes pathfinding algorithms, and a runtime executor project.
We also have three special guests from PyCascades 2023 to dig into the details of the conference. Conference chair Eliza Sarobhasa is CTO at Women Who Drone and Leadership Fellow (Python Track) & Python Developer Advocate at Women Who Code. Sprints chair Chethana Gopinath is a Software Engineer at realtor.com and a Senior Lead at Women Who Code Python. Speaker Support Chair Jolene Wong is a Senior Software Engineer at Cisco based in Vancouver. We discuss hosting a hybrid conference, participating in open-source sprints, and finding a local Python community.
Course Spotlight: The Python print() Function: Go Beyond the Basics
In this step-by-step course, you’ll learn about the print() function in Python and discover some of its lesser-known features. Avoid common mistakes, take your “hello world” to the next level, and know when to use a better alternative.
Topics:
asdf
Rust Clone)News:
Show Links:
Projects:
PyCascades Links:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you still using loops and lists to process your data in Python? Have you heard of a Python library with optimized data structures and built-in operations that can speed up your data science code? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to share secrets for harnessing linear algebra and NumPy for your projects.
Jodie details how most people begin their data science journey using loops to iterate over values and apply operations sequentially. We talk about how loops are friendly for beginners, being clear to read and easy to debug, but unfortunately don’t scale well, especially with large amounts of data.
Jodie shares some of the basics of linear algebra and how to organize data into vectors. We talk about how the NumPy library leverages those concepts to improve data processing. We discuss how the library includes operations for vector and matrix addition and subtraction, and why these operations are more efficient than loops. We also cover how NumPy stores arrays in memory and when working with them is faster vs when it’s not.
Course Spotlight: Data Cleaning With pandas and NumPy
In this video course, you’ll learn how to clean up messy data using pandas and NumPy. You’ll become equipped to deal with a range of problems, such as missing values, inconsistent formatting, malformed records, and nonsensical outliers.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like to practice your Python skills while building a challenging word game? Have you been wanting to learn more about creating command-line interfaces and making them colorful and interactive? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We share a recent Real Python step-by-step project about creating a clone of Wordle. In the project, you’ll practice building a terminal application, validating user input, and refactoring code into functions.
Christopher shares an article that compares two popular testing tools, Nox and Tox. He discusses how each framework approaches test environment configuration and why the author leans toward using Nox’s Python decorator–based format.
We share several other articles and projects from the Python community, including a news update, a guide to trying out code and ideas quickly with the Python REPL, a PEP about requiring virtual environments by default, a discussion about lessons learned in twenty years as a software engineer, a project for a spreadsheet GUI inside of JupyterLab notebooks, and adding C-style for
loops to Python.
Course Spotlight: Getters and Setters in Python
In this video course, you’ll learn what getter and setter methods are, how Python properties are preferred over getters and setters when dealing with attribute access and mutation, and when to use getter and setter methods instead of properties in Python.
Topics:
News:
Show Links:
Discussion
Projects:
for
loop in Python? No? Well, you can have one anyway. See how Tushar implemented with for (i := var(0), i < 10, i + 2):
Additional Links:
Level up your Python skills with our expert-led courses:
Can you describe your business processes with flowcharts? What if you could define the steps in a standard notation and implement the workflows in pure Python? This week on the show, Dan Funk from Sartography is here to discuss SpiffWorkflow.
SpiffWorkflow is a Python tool for translating Business Process Model and Notation (BPMN) diagrams into a workflow engine. You can manipulate this visual chain of events to suit your team’s business requirements. Individual events in the workflow can contain blocks or scripts of Python code to be executed.
We discuss the concept of low-code software tools. Dan also talks about how SpiffWorkflow aims at getting non-developers within an organization involved in development.
Course Spotlight: Cool New Features in Python 3.11 – Real Python
In this video course, you’ll explore what Python 3.11 brings to the table. You’ll learn how Python 3.11 is the fastest and most user-friendly version of CPython yet, and learn about improvements to the typing system and to the asynchronous features of Python.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like to quickly add data to a map with Python? Have you wanted to create beautiful interactive maps and export them as a stand-alone static web page? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We share a recent Real Python tutorial about using Python Folium to create geospatial data visualizations. Folium harnesses the power of the JavaScript library Leaflet. The project shares how to combine this graphical power with Python’s data-wrangling strength.
Christopher shares a recent Python Enhancement Proposal (PEP) about the Global Interpreter Lock (GIL) in CPython. The PEP proposes a change to the build process that implements a flag for optionally building a GIL-less interpreter.
We share several other articles and projects from the Python community, including a news update, a YAML
document from hell, a set of logging practices to follow, a discussion about the discourse surrounding the recent Python packaging user survey, a modern Python UI library based on Tkinter, and a lightweight tool kit for bounding boxes.
Course Spotlight: Everyday Project Packaging With pyproject.toml
In this Code Conversation video course, you’ll learn how to package your everyday projects with pyproject.toml
. Playing on the same team as the import system means you can call your project from anywhere, ensure consistent imports, and have one file that’ll work for many build systems.
Topics:
News:
Show Links:
yaml
Document From Hell – As a data format, YAML is extremely complicated and it has many footguns. In this post, Ruud explains some of those pitfalls by means of an example and suggests a few simpler and safer YAML alternatives.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you worked on a project that needed an orchestration tool? How do you define the workflow of an entire data pipeline or a messaging system with Python? This week on the show, Calvin Hendryx-Parker is back to talk about using Apache Airflow and orchestrating Python projects.
Calvin is the co-founder and CTO of Six Feet Up and a Python Web Conference co-organizer. He’s recently been working on a massive project that requires thousands of jobs involving transferring and transforming data. Through his research into orchestration systems, he found Apache Airflow.
Airflow is an open-source tool to define, schedule, and monitor workflows. The platform is pure Python and integrates with a wide variety of services. We discuss how workflows are defined by creating directed acyclic graphs (DAG).
Calvin talks about how a recent project outgrew the system and how his team built a clever solution using Python. We also discuss the upcoming Python Web Conference and what virtual attendees can expect.
Course Spotlight: Python Basics: Object-Oriented Programming
In this video course, you’ll get to know OOP, or object-oriented programming. You’ll learn how to create a class, use classes to create new objects, and instantiate classes with attributes.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you used the Python Read-Eval-Print Loop (REPL) to explore the language and learn about how it operates? Would it help if it provided syntax highlighting, definitions, and code completion and behaved more like an IDE? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss the drop-in REPL replacement bpython. bpython enhances the interactivity of a Python REPL session. It’s also a powerful teaching tool for instructors and students to experiment with and explore Python code.
Christopher shares a recent Python Enhancement Proposal (PEP) about formalizing the grammar for f-strings. The PEP describes a reduction in the underlying parser code complexity and provides for future features like comments in multiline f-strings.
We share several other articles and projects from the Python community, including a news roundup, a collection of surveys to classify Python virtual environment workflows, a course about context managers and Python’s with
statement, a discussion about microfeatures that we would like to see adopted in Python, a Python terminal music player, and an infinite array powered by AI.
Course Spotlight: Context Managers and Python’s with
Statement
In this video course, you’ll learn what the Python with
statement is and how to use it with existing context managers. You’ll also learn how to create your own context managers.
Topics:
with
StatementNews:
Show Links:
with
Statement – In this video course, you’ll learn what the Python with
statement is and how to use it with existing context managers. You’ll also learn how to create your own context managers.2 <= x < 10
) and numbers with separators (1000000 == 1_000_000).Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How can you get more performance from your existing data science infrastructure? What if a DataFrame library could take advantage of your machine’s available cores and provide built-in methods for handling larger-than-RAM datasets? This week on the show, Liam Brannigan is here to discuss Polars.
Liam is an experienced data scientist working in finance, technology, and environmental analysis. He’s recently started contributing to the documentation for Polars and developing a training course for the library.
We talk about the library’s overall speed and lack of additional dependencies. Liam explains the advantages of lazy vs eager mode and which to choose when performing data exploration or attempting to load a dataset larger than your RAM.
We also discuss potential barriers to switching to Polars from a pandas workflow. Across our conversation, we explore several other libraries and technologies, including Apache Arrow, DuckDB, query optimization, and the “rustification” of Python tools.
Course Spotlight: Graph Your Data With Python and ggplot
In this course, you’ll learn how to use ggplot in Python to build data visualizations with plotnine. You’ll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way.
Show Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you embraced the use of comprehensions in your Python journey? Are you familiar with all the varieties of comprehension constructs? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent article that surveys Python’s comprehensions and generators. This overview includes code snippets and the fundamentals of creating list, set, and dictionary comprehensions. We weigh the advantages of using a comprehension versus the more familiar for
loops that they replace.
Christopher shares an article about how there may be infighting between the parallelism in your Python code and the parallelism within the libraries that you’re using. These complex system interactions can cause processing slowdowns and hard-to-trace bottlenecks.
We share several other articles and projects from the Python community, including a news roundup, a Python linter comparison, an overview of multiprocessing race conditions in Python, a discussion covering import
statement styles, a project for WASM-powered Jupyter tools running in the browser, and a collection of easter eggs and jokes hidden inside Python itself.
Course Spotlight: Understanding Python List Comprehensions
Python list comprehensions make it easy to create lists while performing sophisticated filtering, mapping, and conditional logic on their members. In this course, you’ll learn when to use list comprehensions in Python and how to create them effectively.
Topics:
import
Statement Do You Use?News:
Show Links:
multiprocessing
module.Discussion:
import
Statement Do You Use?Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
It’s been another year of changes at Real Python! The Real Python team has written, edited, curated, illustrated, and produced a mountain of Python material this year. We added some new members to the team, updated the site’s features, and created new styles of tutorials and video courses.
Three members of the Real Python team join us this week, Kate Finegan, Geir Arne Hjelle, and Leodanis Pozo Ramos. We wanted to share a year-end wrap-up with tutorials, step-by-step projects, and video courses that showcase what our team created this year.
Kate and Geir Arne help to shepherd articles through the multi-stage editing process. Along with the rest of the team, they make sure these resources impart crucial Python knowledge and provide a thorough didactic experience. Leodanis’ name has been featured many times on this podcast, and it was great to talk to him about writing tutorials and diving deep into the Pythonic details.
We hope you enjoy this review! Programming note, there won’t be an episode next week, but we’ll be back in January and look forward to bringing you a year full of great guests, articles, and topics.
Course Spotlight: Building Python Project Documentation With MkDocs
In this video course, you’ll learn how to build professional documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and, more importantly, from your code’s docstrings.
Topics:
Show Links:
Additional Links:
Level up your Python skills with our expert-led courses:
What advantages can a build system provide for a Python developer? What new skills are required when working with a team of developers? This week on the show, Benjy Weinberger from Toolchain is here to discuss the Pants build system and getting started with continuous integration (CI).
Benjy is one of the core developers of the Pants build system. He talks about the software tools and processes that a build system simplifies. We discuss how an individual developer can take advantage of continuous integration. We also cover some of the expectations when moving into professional software development.
Have you learned about or started to use tools like linters, code formatters, import sorters, type checkers, and packaging systems? A build system is designed to combine all of those tools into a simplified, one-step process to share your best code.
Benjy explains concepts like implementing fine-grained invalidation, moving to a monorepo, and using a build system for data science projects. He also shares his tips for getting started with Pants and finding help within the community.
Course Spotlight: Testing Your Code With pytest
In this video course, you’ll learn how to take your testing to the next level with pytest. You’ll cover intermediate and advanced pytest features such as fixtures, marks, parameters, and plugins. With pytest, you can make your test suites fast, effective, and less painful to maintain.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you start packaging your code with pyproject.toml? Would you like to join a conversation that gently walks you through setting up your Python projects to share? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a recent code conversation featuring Real Python team members Ian Currie and Geir Arne Hjelle. The video dives into the officially sanctioned way to configure your project using a pyproject.toml
file. We cover how this relatively new approach will help you package your code for use on your system or for sharing with others.
Christopher shares a Real Python tutorial about using pathlib
to get a list of all the files within a directory. We’re both fans of pathlib
and how it simplifies working with file paths. The tutorial digs into methods to recursively list all directory contents or create a conditional listing.
We share several other articles and projects from the Python community, including an explanation of Python bytecode, an argument for always using [closed, open)
intervals, a discussion about building the monolith before microservices, a way to parse natural language time and date expressions, and a project for posting on Mastodon.
Course Spotlight: Using Python’s pathlib Module
In this video course, you’ll learn how to effectively work with file system paths in Python 3 using the pathlib
module in the standard library.
Topics:
[closed, open)
Intervalspyproject.toml
Show Links:
[closed, open)
Intervals – “Intervals or ranges pop-up everywhere in the programming world. The classic example is picking a start and end date, like you would when booking an AirBnB or a flight. Have you ever wondered why they are always implemented as [closed, open) as opposed to [closed, closed]?”pyproject.toml
– In this Code Conversation video course, you’ll learn how to package your everyday projects with pyproject.toml
. Playing on the same team as the import system means you can call your project from anywhere, ensure consistent imports, and have one file that’ll work for many build systems.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How do you prepare a dataset for machine learning (ML)? How do you go beyond cleaning the data and move toward measuring how the model performs? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to talk about strategies for better ML model performance.
Jodie starts by defining some terms for the conversation. We talk about targets, features, and supervised learning.
We discuss three common ways that data can alter model performance and which Python tools can help spot and avoid them. Jodie shares personal experiences of working through these pitfalls. We also share a healthy collection of resources to explore and learn more.
Course Spotlight: Combining Data in pandas With concat() and merge()
In this video course, you’ll learn two techniques for combining data in pandas: merge() and concat(). Combining Series and DataFrame objects in pandas is a powerful way to gain new insights into your data.
Topics:
classification_table
Show Links:
Level up your Python skills with our expert-led courses:
How do you build a REST API using the Flask web framework? How can you quickly add endpoints while automatically generating documentation? This week on the show, Real Python author Philipp Acsany is here to discuss his tutorial series “Python REST APIs With Flask, Connexion, and SQLAlchemy.” Christopher Trudeau is also here with another batch of PyCoder’s Weekly articles and projects.
Philipp talks about updating a set of tutorials to use current libraries and best practices. The series takes you through building the base Flask project, defining endpoints, creating documentation, adding a persistent database, and implementing models with SQLAlchemy.
Christopher shares an article about contributing to an existing internal or open-source project by properly preparing pull requests. The article is titled “Ten Tasty Ingredients for a Delicious Pull Request”.
We share several other articles and projects from the Python community, including more suspicious PyPI packages using new tactics, method chaining in pandas, tools to find syntax errors without stopping, a library for searching text in videos using optical character recognition (OCR), a project for visualizing CPython’s specializing adaptive interpreter, and a library for building CLI applications based on type hints.
Course Spotlight: The Pandas DataFrame: Working With Data Efficiently
In this course, you’ll get started with pandas DataFrames, which are powerful and widely used two-dimensional data structures. You’ll learn how to perform basic operations with data, handle missing values, work with time-series data, and visualize data from a pandas DataFrame.
Topics:
Show Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What if you didn’t have to worry about managing user passwords as a Python developer? That’s where the WebAuthn protocol and new hardware standards are heading. This week on the show, Dan Moore from FusionAuth returns to discuss a password-less future.
WebAuthn is a way to authenticate users using biometric, secure authentication methods. Dan dives into passkeys, ceremonies, authenticators, and hardware standards. We also cover several projects and libraries that can help you get started with WebAuthn in Python.
Course Spotlight: Refactoring: Prepare Your Code to Get Help
In this Code Conversation video course, you’ll explore the steps you can take to get help when you’re stuck while coding. You’ll investigate how to clean up your code to focus on the question you have. Along the way, you’ll learn how to handle errors and use custom exceptions.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you create a computer opponent for a simple game within Python? Would you also like to learn how to adapt the game to run in a web browser or graphical user interface (GUI)? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a recent Real Python step-by-step project for creating a tic-tac-toe game engine. He talks about how to build the game engine and adapt it for different front ends. The tutorial also shows how to implement an unbeatable computer player using the minimax algorithm.
We discuss an article about how to avoid repeating yourself when creating decorators with multiple parameters. We talk about how you can stop copying and pasting code several times by assigning the decorator to a new variable.
We share several other articles and projects from the Python community, including a news roundup, a deep dive into Python’s doctest, several Python command line tricks, type annotations via automated refactoring, a new way to draw boxes in the terminal, a collection of projects for beginners with source code, a minimalist PDF creation library, and a tool for sensible logging in Python.
Course Spotlight: Python Decorators 101
In this course on Python decorators, you’ll learn what they are and how to create and use them. Decorators provide a simple syntax for calling higher-order functions in Python. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it.
Topics:
News:
Topics:
python -m
you can do all sorts of things from the command line, including starting a webserver, opening a browser, parsing JSON, compressing files, and much more.Discussion:
Projects:
log2d
, a third-party wrapper for the Python logging library.Additional Links:
Level up your Python skills with our expert-led courses:
Python 3.11 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to talk about the new version. Geir Arne wrote a series of preview tutorials earlier this year, and his annual piece, titled “Python 3.11: Cool New Features for You to Try,” was published on October 24. Christopher’s video course came out the next day, covering the topics from the tutorial with visual examples of Python 3.11 in action.
Geir Arne and Christopher collaborated to create code examples for the new features. We discuss better error messages, faster code execution, task and exception groups, typing features, and native TOML support.
We dive into the updates and offer advice about ways to incorporate them into your projects. We also consider when you should start running Python 3.11.
Course Spotlight: Cool New Features in Python 3.11 – Real Python
In this video course, you’ll explore what Python 3.11 brings to the table. You’ll learn how Python 3.11 is the fastest and most user-friendly version of CPython yet, and learn about improvements to the typing system and to the asynchronous features of Python.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Does your company have a plan for growing an internal Python community? What are the attributes to look for when bringing someone into your department? This week on the show, Pablo Galindo Salgado returns to talk about building community through the Python Guild at Bloomberg and managing the release of Python 3.11.
Pablo describes how the Python Guild started and currently operates inside Bloomberg. We talk about how it fosters community and acts as a way to promote internally developed tools across disparate teams. We also discuss how work groups use it to find new internal candidates for their teams.
Pablo talks about his role as release manager for Python 3.10 and 3.11. He shares the intense journey the team has had this year in preparing for the release of 3.11. He details updating testing strategies to work with the new specializing adaptive interpreter.
Course Spotlight: Python Basics: Strings and String Methods
In Python, collections of text are called strings. In this course, you’ll learn about this fundamental data type and the string methods that you can use to manipulate strings. Along the way, you’ll learn ways to work with strings of numbers, and how to format strings for printing.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Where should you use an ellipsis in Python? How does it behave as a placeholder in a script, project, or stub file? What are the next goals for the Faster CPython project? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We talk about a Real Python article that covers when you should use an ellipsis in Python. We discuss the similarities with the pass
keyword and how it’s used for type hints within stub files.
Christopher shares resources covering the goals of the Faster CPython project. We’re on the cusp of the release of Python 3.11, but the project keeps moving forward as they look at ways to continue speeding up Python.
We share several other articles and projects from the Python community, including a news roundup, alternatives for hosting Python-based applications, ways to create custom Python strings, a discussion about aging programmers, a structural diff that understands syntax, and a project for refurbishing and modernizing Python codebases.
Course Spotlight: Providing Multiple Constructors in Your Python Classes
In this video course, you’ll learn how to provide multiple constructors in your Python classes. To this end, you’ll learn different techniques, such as checking argument types, using default argument values, writing class methods, and implementing single-dispatch methods.
Topics:
str
vs UserString
News:
@override
, which would be used as a type hint for methods in a subclass that override a parent’s method. This type hint would introduce a level of safety if the parent method is refactored without corresponding changes to the child method.Show Links:
Ellipsis
constant can come in handy for you.str
vs UserString
– In this tutorial, you’ll learn how to create custom string-like classes in Python by inheriting from the built-in str
class or by subclassing UserString
from the collections
module.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you used a memory profiler to gauge the performance of your Python application? Maybe you’re using it to troubleshoot memory issues when loading a large data science project. What could running a profiler show you about a codebase you’re learning? This week on the show, Pablo Galindo Salgado returns to talk about Memray, a powerful tracing memory profiler.
Pablo developed Memray while working at Bloomberg to track memory allocations beyond Python code into native extensions and the interpreter itself. It’s a compelling tool that provides fine-grain reports to help you understand where memory is used.
Pablo shares the reporting that Memray provides, including live mode, flame graphs, and a pytest
plug-in. We also discuss how a tracing memory profiler can help you understand a new codebase.
He walks through how he developed the first prototype internally and eventually moved the project into open source. This is the first part of my conversation with Pablo. In a couple of weeks, you’ll get the second part, where we talk about Python guilds inside large companies and his work as the release manager for Python 3.10 and 3.11.
Course Spotlight: SQLite and SQLAlchemy in Python: Moving Your Data Beyond Flat Files
In this video course, you’ll learn how to store and retrieve data using Python, SQLite, and SQLAlchemy as well as with flat files. Using SQLite with Python brings with it the additional benefit of accessing data with SQL. By adding SQLAlchemy, you can work with data in terms of objects and methods.
Topics:
pytest
plug-inShow Links:
Level up your Python skills with our expert-led courses:
Have you ever used code to help explain a topic? How can Python scripts be used to understand the intricacies of access control? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher talks about an article that explores the evolution of access control by reimplementing the concepts with Python scripts. The experiment moves across the various access forms, starting with control lists, roles, and attributes, then ending with purpose-based access control (PBAC).
We also cover a post about how to create dangerous pickles. We discuss where malicious code can hide within the serialization process and how decompiling code can be an education tool.
We share several other articles and projects from the Python community, including command line interface (CLI) creation with argparse
, HTML and CSS for Python developers, a Python packaging user survey, a visual Python Tkinter GUI creator, a PyScript-based data visualization cookbook, and a project for writing functional test helpers in Django.
Course Spotlight: Serializing Objects With the Python pickle Module
In this course, you’ll learn how you can use the Python pickle
module to convert your objects into a stream of bytes that can be saved to a disk or sent over a network. You’ll also learn the security implications of using this process on objects from an untrusted source.
Topics:
Show Links:
argparse
.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you interested in using Python in an industry outside of software development? Would adding a few custom software tools increase efficiency and make your coworkers’ jobs easier? This week on the show, Josh Burnett talks about using Python as a mechanical engineer.
I met Josh at PyCon US 2022 in Salt Lake City, which he attended for the first time with several coworkers. He suggested we do an episode to shed some light on ways that Python is being used professionally by people who aren’t primarily programming for a living.
Josh works as a mechanical engineer for an equipment manufacturer, where he needs to perform repetitive tasks and generate copious logs. He explains how he moved his team away from MATLAB and toward Python.
We discuss his progression from writing scripts to developing packages and eventually hosting his work on PyPI. He also shares his explorations with CircuitPython for personal and professional projects.
Course Spotlight: Building Python Project Documentation With MkDocs
In this video course, you’ll learn how to build professional documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and, more importantly, from your code’s docstrings.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you thought the standard output from Matplotlib is a bit generic looking? Would you like a quick way to add style and consistency to your data visualizations? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We cover an article about the magic of creating style sheets for Matplotlib. You can quickly customize plots and graphs with a single line of code. We share additional resources for you to try out new styles and learn what parameters are customizable.
Christopher covers an article about using async for web development in Python. The creation of Python generators inspired the development of async functionality. He discusses recent changes and async additions within Python web frameworks.
We cover several other articles and projects from the Python community, including how to install a pre-release version of Python, cache in Python with lru_cache, and get better at debugging, along with suggestions of libraries that deserve attention, a Python library for creating mathematical animations, and an extremely fast Python linter that’s written in Rust.
Course Spotlight: Python Debugging With pdb
In this hands-on course, you’ll learn the basics of using pdb, Python’s interactive source code debugger. pdb is a great tool for tracking down hard-to-find bugs, and it allows you to fix faulty code more quickly.
Topics:
Show Links:
async
support. The Python web ecosystem has been seeing new frameworks pop up which are fully async
, or support going fully async, from the start.” Learn more about async
and its use in web frameworks.@lru_cache
decorator to cache the results of your functions using the LRU cache strategy. This is a powerful technique you can use to leverage the power of caching in your implementations.Discussions:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you wanted to understand recursion and how to use it in Python? Are you familiar with the call stack and how it relates to tracebacks? This week on the show, Al Sweigart talks about his new book, “The Recursive Book of Recursion.”
Recursion is one of those concepts held as a tenet of high-level computer science priesthood. Al explains the fundamentals of writing recursive functions and a critical missing piece in understanding how they operate, the call stack. After completing his research, he concluded that it’s a technique that you should understand but rarely use.
He also shares the few cases where recursion is an appropriate solution. Along the way, we talk about directed acyclic graphs, solving mazes, exploring file trees, and creating fractal images.
Course Spotlight: Caching in Python With lru_cache
Caching is an essential optimization technique. In this video course, you’ll learn how to use Python’s @lru_cache decorator to cache the results of your functions using the LRU cache strategy. This is a powerful technique you can use to leverage the power of caching in your implementations.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How does a code completion tool work? What is an Abstract Syntax Tree, and how is it created in Python? How does an AST help you write programs and projects that inspect and modify your Python code? This week on the show, Meredydd Luff, co-founder of Anvil, shares his PyCon talk, “Building a Python Code Completer.”
Meredydd talks about his experience building a code completion engine for the Anvil platform. The conversation leads us to discuss how Python parses the code that you type. We examine tokenization, abstract syntax trees, and how parsing has changed in Python.
We cover additional projects that you can explore once you have a tool that inspects the Python code you’re writing. Join us as we dive into multiple rabbit holes of research and exploration.
Course Spotlight: Python Assignment Expressions and Using the Walrus Operator
In this course, you’ll learn about assignment expressions and the walrus operator. The biggest change in Python 3.8 was the inclusion of the :=
operator, which you can use to assign variables in the middle of expressions. You’ll see several examples of how to take advantage of this feature.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you attempted to set up a Python development environment on Windows before? Would it be helpful to have an easy-to-follow guide to get you started? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We talk about a Real Python tutorial that covers configuring a Windows coding environment. The guide contains valuable suggestions, best practices, and powerful coding tools. It also covers how to use a package manager, the new Windows Terminal, PowerShell Core, and a program to manage multiple versions of Python.
Christopher covers another Real Python tutorial about using TOML in Python. TOML is a configuration format for building and distributing your own packages. We discuss how TOML parsing will be added to Python’s standard library in version 3.11.
We cover several other articles and projects from the Python community, on topics including technical writing for developers, a news round-up, a farewell to obsolete Python libraries, uncommon uses of Python in commonly used libraries, a prettier ls
, and a project for advanced hot reloading in Python.
Course Spotlight: Python Basics: Finding and Fixing Code Bugs
In this Python Basics video course, you’ll learn how to identify and fix logic errors, or bugs, in your Python code. You’ll use the built-in debugging tools in Python’s Integrated Development and Learning Environment to practice locating and resolving bugs in an example function.
Topics:
News:
Topic Links:
os.path
, random
, pytz
, namedtuple
and many more obsolete Python libraries. Start using the latest and greatest ones instead.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What’s the big breakthrough for Natural Language Processing (NLP) that has dramatically advanced machine learning into deep learning? What makes these transformer models unique, and what defines “attention?” This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, continues our talk about how machine learning (ML) models understand and generate text.
This episode is a continuation of the conversation in episode #119. Jodie builds on the concepts of bag-of-words, word2vec, and simple embedding models. We talk about the breakthrough mechanism called “attention,” which allows for parallelization in building models.
We also discuss the two major transformer models, BERT and GPT3. Jodie continues to share multiple resources to help you continue exploring modeling and NLP with Python.
Course Spotlight: Building a Neural Network & Making Predictions With Python AI
In this step-by-step course, you’ll build a neural network from scratch as an introduction to the world of artificial intelligence (AI) in Python. You’ll learn how to train your neural network and make predictions based on a given dataset.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Is there someone in your life you’d like to inspire to learn Python? Mission Encodeable is a website designed to teach people to code, built by two high-school students. This week on the show, Anna and Harry Wake talk about creating their site and motivating people to start coding.
We discuss why they decided to build the site. Anna and Harry initially felt that the site would be for other students but soon realized it could be helpful for anyone interested in starting to code in Python. We cover the project-based approach and how they implemented the interactive browser-based tool replit.com.
We talk about learning Python in the classroom and how they found additional books and tutorials to supplement their coding education. Anna and Harry also created a resource hub to help teachers take advantage of the site.
Course Spotlight: Rock, Paper, Scissors With Python: A Command Line Game
In this course, you’ll learn to program rock paper scissors in Python from scratch. You’ll learn how to take in user input, make the computer choose a random action, determine a winner, and split your code into functions.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you process and classify text documents in Python? What are the fundamental techniques and building blocks for Natural Language Processing (NLP)? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, talks about how machine learning (ML) models understand text.
Jodie explains how ML models require data in a structured format, which involves transforming text documents into columns and rows. She covers the most straightforward approach, called binary vectorization. We discuss the bag-of-words method and the tools of stemming, lemmatization, and count vectorization.
We jump into word embedding models next. Jodie talks about WordNet, Natural Language Toolkit (NLTK), word2vec, and Gensim. Our conversation lays a foundation for starting with text classification, implementing sentiment analysis, and building projects using these tools. Jodie also shares multiple resources to help you continue exploring NLP and modeling.
Course Spotlight: Learn Text Classification With Python and Keras
In this course, you’ll learn about Python text classification with Keras, working your way from a bag-of-words model with logistic regression to more advanced methods, such as convolutional neural networks. You’ll see how you can use pretrained word embeddings, and you’ll squeeze more performance out of your model through hyperparameter optimization.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How do you start building your project documentation? What if you had a tool that could do the heavy lifting and automatically write large portions directly from your code? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We talk about a Real Python step-by-step project from Martin Breuss about MkDocs. The project walks you through generating nice-looking and modern documentation from Markdown files and your existing code’s docstrings. The final step is to deploy your freshly generated documentation to a GitHub repository.
Christopher talks about a pair of articles arguing for and against using Python dictionaries. The first article, “Just Use Dictionaries,” pushes to keep things simple, while the second article, “Don’t Let Dicts Spoil Your Code,” contends that complex projects require something more specific.
We cover several other articles and projects from the Python community, including discussing the recent beta release of Python 3.11, 2FA for PyPI, procedural music composition with arvo, building a tic-tac-toe game with Python and Tkinter, common issues encountered while coding in Python, a type-safe library to generate SVG files, and a lightweight static analysis tool for your projects.
Course Spotlight: Dictionaries and Arrays: Selecting the Ideal Data Structure
In this course, you’ll learn about two of Python’s data structures: dictionaries and arrays. You’ll look at multiple types and classes for both of these and learn which implementations are best for your specific use cases.
Topics:
News:
Topic Links:
dict
is the go-to data structure for Python programmers, but its loose relationship to the data can be problematic in large data streams. Learn more about why and when you might choose a different data structure.music21
and avro
libraries, you can create musical scores programmatically. This article runs you through which libraries you need and how you can compose your own music.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How maintainable is your Python code? Is it possible to hold the code for your functions in your head? When is it appropriate to use measurements in a code review? This week on the show, Reka Horvath and Ben Martineau from Sourcery are here to discuss their recent PyCon talk, “Actionable insights vs ranking: How to use and how NOT to use code quality metrics.”
Reka and Ben share their thoughts on how metrics can provide insights into your Python code. We discuss four measurements of code complexity and what factors into each.
We also talk about deciding whether to refactor or rewrite code. Ben and Reka share their experience in code review situations and the importance of shifting the conversation from subjective opinions toward objective measurements.
Course Spotlight: Writing Idiomatic Python
What are the programming idioms unique to Python? This course is a short overview for people coming from other languages and an introduction for beginners to the idiomatic practices within Python. You’ll cover truth values, looping, DRY principles, and the Zen of Python.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like to explore the functional programming side of Python? What are the advantages of this approach, and what tools are built into the language? This week on the show, author Bruce Eckel talks about functional programming in Python.
Bruce is the author of several programming books, including Thinking in Java, Thinking in C++, Thinking in Python, Atomic Scala, and most recently, Atomic Kotlin. He’s been an explorer of programming languages over his career. Functional programming—with its lack of side effects, its transparency, and its potential for parallelization—has recently caught Bruce’s attention.
Bruce’s talk “Making Data Classes Work for You” at PyCon US 2022 explored the idea of the invariance of objects.
We also discuss his next book project, the Python community, and his affection for “un-conferences”. Bruce is hosting the upcoming Summer Tech Forum in Crested Butte, Colorado, this August.
Course Spotlight: Using Data Classes in Python
Data classes were introduced in Python 3.7. When using data classes, you don’t have to write boilerplate code to get proper initialization, representation, and comparisons for your objects.
Topics:
__post_init__
Show Links:
Level up your Python skills with our expert-led courses:
Have you heard about PyScript? The brand-new framework has the community excited about building interactive Python applications that run entirely within the user’s browser. Would you like to dig into the details beyond the “Hello World” examples? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We talk about a Real Python tutorial from Bartosz Zaczyński about PyScript. The article provides an initial look at the framework and then takes you deep into the intricacies. We also share additional resources to help familiarize you with the project.
Christopher talks about another Real Python article, this one on how to approach managing errors in Python. The tutorial “LBYL vs EAFP: Preventing or Handling Errors in Python” is from frequent contributor Leodanis Pozo Ramos.
We cover several other articles and projects from the Python community, including discussing the PSF’s Python Developers Survey 2021 Results, Django static files and templates, how to profile Python code, a launcher for penetration testing, and a project for confirming Python versions through syntax errors.
Course Spotlight: Building a Django User Management System
In this video course, you’ll learn how to extend your Django application with a user management system, complete with email sending and third-party authentication.
Topics:
Topics Links:
profile
, and timeit
libraries, along with others.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you interested in a career in security using Python? Would you like to stay ahead of potential vulnerabilities in your Python applications? This week on the show, James Pleger talks about Python information security, incident response, and forensics.
James has been doing information security for over fifteen years, working at some of the biggest companies, government agencies, and startups. He shares numerous Python resources to dive into detecting threats and improving your projects.
We discuss how to learn about security topics and get involved in the community. Make sure you check out the massive collection of links in the show notes this week.
Course Spotlight: Exploring HTTPS and Cryptography in Python
In this course, you’ll gain a working knowledge of the various factors that combine to keep communications over the Internet safe. You’ll see concrete examples of how to keep information secure and use cryptography to build your own Python HTTPS application.
Topics:
Security Specific Tools Written in Python:
Incident Response and Memory Forensics:
Honeypot Resources:
Bug Bounty Programs:
Security and Hacking Conferences:
Additional Links:
Level up your Python skills with our expert-led courses:
Would you like a fast way to share your data science project results as an interactive dashboard instead of a Jupyter notebook? Streamlit is a library for creating simple web apps and dashboards using just Python. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We talk about the article “Forget About Jupyter Notebooks - Showcase Your Research Using Dashboards.” It covers the basics of turning a data science script into an interactive dashboard using Streamlit. We also share some additional resources to get you started with the library.
Christopher discusses an article covering ways to make life easier when working with Python regular expressions. He talks about composing verbose regexes using f-strings and potentially reusing these patterns.
We cover several other articles and projects from the Python community, including a news roundup, a step-by-step project to build a URL shortener with FastAPI, the fact that Python’s functions are sometimes classes, an automatic water pistol pigeon deterrent project, a discussion about music playlists for coding, a project for Python metadata extraction without execution, and a powerful audio-to-MIDI converter library.
Course Spotlight: Using Python Class Constructors
In this video course, you’ll learn how class constructors work in Python. You’ll also explore Python’s instantiation process, which has two main steps: instance creation and instance initialization.
Topics:
News:
Topic Links:
list()
or enumerate()
? Think of them as functions? They’re not—they’re classes. Sometimes we call classes functions in Python. Why? And what’s a “callable”?openCV
reading the camera image from an old iPhone. See all the details.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What do you do when your data science project doesn’t fit within your computer’s memory? One solution is to distribute it across multiple worker machines. This week on the show, Guido Imperiale from Coiled talks about Dask and managing large data science projects through distributed computing.
We talk about projects where an orchestration system like Dask will help. Dask is designed to take advantage of parallel computing, spreading the work and data across multiple machines. Many familiar techniques for working with pandas and NumPy data are supported with Dask equivalents.
We also discuss the differences between managed and unmanaged memory. Guido shares advice on how to tackle memory issues while working with Dask.
This week we also talk briefly with Jodie Burchell, who will be a guest host on upcoming episodes. As a data scientist, Jodie will be bringing new topics, projects, and discussions to the show.
Course Spotlight: Exploring Scopes and Closures in Python
In this Code Conversation video course, you’ll take a deep dive into how scopes and closures work in Python. To do this, you’ll use a debugger to walk through some sample code, and then you’ll take a peek under the hood to see how Python holds variables internally.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
What are the differences between the various Python game frameworks? Would it help to see a couple of game examples across several libraries to understand the distinctions? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We discuss a Real Python article by previous guest Jon Fincher titled “Top Python Game Engines”. Jon compares five different game frameworks and provides example projects and thorough commentary for each.
We talk about a blog post by recent guest Adam Johnson about determining if a project is well maintained. He suggests twelve questions to decide whether to add a new dependency to your project.
We cover several other articles and projects from the Python community, including a news roundup, Python decorator patterns, finding the smallest and largest values with min()
and max()
, a discussion about the most-used Python packages, the pony object-relational mapper, and a project to read PEPs in your console.
Course Spotlight: Using Pygame to Build an Asteroids Game in Python
In this course, you’ll build a clone of the Asteroids game in Python using Pygame. Step by step, you’ll add images, input handling, game logic, sounds, and text to your program.
Topics:
News:
Topic Links:
min()
and max()
.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Would you like a way to send structured serialized data between different platforms and languages? What if the data was self-documenting, could automatically generate Python code, and would validate itself? This week on the show, Liran Haimovitch talks about protocol buffers and communicating with microservices through Remote Procedure Calls (RPC).
Protocol buffers, aka protobuf, are a language-neutral, platform-neutral system for serializing structured data. Liran talks about how they go beyond text-based protocols like JSON, providing the benefits above, along with faster transmissions and a smaller footprint.
Liran shares how his company uses protobuf to communicate between their tools. We also discuss using gRPC to communicate between microservices and scaling infrastructure in either direction.
Course Spotlight: Testing Your Code With pytest
In this video course, you’ll learn how to take your testing to the next level with pytest. You’ll cover intermediate and advanced pytest features such as fixtures, marks, parameters, and plugins. With pytest, you can make your test suites fast, effective, and less painful to maintain.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Did you know you can add testing to your Python code while simultaneously documenting it? Using docstrings, you can create examples of how your functions should interact in a Python REPL and test them with the built-in doctest module. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares an article by previous guest Mike Driscoll about testing with doctest. This is a great way to get started with testing your own code, and it offers the added benefit of documenting functionality.
We talk about the recent Real Python article “Pagination for a User-Friendly Django App.” Spreading your content across multiple pages can significantly improve the user experience of your web application. This article takes you through configuring Django’s built-in pagination tool and how to combine it with other web tools.
We discuss a recent article about Python type hints and the author’s disappointment. We also include reactions from a couple of online communities.
We cover several other articles and projects from the Python community, including why it’s important to close files in Python, how dunder methods are awesome, a bidirectional Python dictionary, prettier git diffs, and a command-line game to learn git.
Spotlight: Python Coding Interviews: Tips & Best Practices
In this step-by-step course, you’ll learn how to take your Python coding interview skills to the next level and use Python’s built-in functions and modules to solve problems faster and more easily.
Topics:
Topic Links:
__repr__
, __str__
, operator overloading, and getting your classes working with Python functions like len()
.doctest
module allows you to write unit tests through REPL-like sessions in your docstrings. Learn how to write and execute doctest
code. Also available in video.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you heard about the projects working toward getting Python to run in the browser? Maybe you would like to try it out for yourself, by building an interactive Python REPL with Pyodide and WebAssembly (WASM). This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects.
We talk about a step-by-step project that shows you how to build a Python code editor in the browser using WebAssembly through Pyodide and CodeMirror. You’re going to be hearing a lot about Pyodide in the coming months, and here’s a chance for you to play around while building a small project.
Christopher shares an article about the power of Python f-strings. It covers some lesser-known features like variable debugging, nesting, and detailed formatting.
We also have a couple of topics up for discussion this week. They’re both related to finding work as a Python developer.
We cover several other articles and projects from the Python community, including the 2038 date problem, a primer about Python virtual environments, how to build a site connectivity checker in Python, a free book on digital signal processing in Python, and a project to build a voice-activated, password-protected wooden box.
Spotlight: Using Python’s datetime Module
Have you ever wondered about working with dates and times in Python? In this video course, you’ll learn all about the built-in Python datetime library. You’ll also learn about how to manage time zones and daylight saving time, and how to do accurate arithmetic on dates and times.
Topics:
Topic Links:
venv
module, as well as the reasoning behind using virtual environments.Discussions:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Are you using an Object-Relational Mapper (ORM) for your Python projects? What if it could work with SQL or No-SQL databases and be fully type-safe? This week on the show, Robert Craigie talks about Prisma Client Python.
Prisma Client Python is built on top of Prisma, which was created for TypeScript and Node.js. It uses a schema file to declare your application’s data models and relationships in a human-readable form. The schema file allows you to easily switch the database type.
Prisma Client is different from other Python ORMs. It is fully type-safe and can be used with or without async.
We talk about how Robert started the project and what types of challenges he’s faced. He also shares areas of improvement and how to contribute to the project.
We also have a conversation with several Real Python core team members about PyCon US 2022. We will have a booth at the conference where we hope you’ll come and connect with us. The team also shares what to expect from PyCon and what they’re excited about this year.
Course Spotlight: Python REST APIs With FastAPI
In this course, you’ll learn the main concepts of FastAPI and how to use it to quickly create web APIs that implement best practices by default. By the end of it, you will be able to start creating production-ready web APIs.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Do you know the difference between creating a class instance and initializing it? Would you like an interactive tour of the Python Pillow library? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects.
We talk about the recent Real Python tutorial “Image Processing With the Python Pillow Library.” It walks you through manipulating, filtering, and creating images from scratch.
Christopher shares an article about Python class constructors, exploring the two-step instance creation and initialization process.
We also have a couple of discussions this week. The first is about contributing to open source projects. The second topic is about searching large codebases before adding features.
We cover several other articles and projects from the Python community, including the counter-intuitive rise of Python in scientific computing, preparation for interview questions, a project for adding pointer hell to Python, and a fast and powerful graphical user interface tool kit for Python with minimal dependencies.
Spotlight: Python vs JavaScript for Python Developers
Python and JavaScript are two of the most popular programming languages in the world. In this course, you’ll take a deep dive into the JavaScript ecosystem by comparing Python vs JavaScript. You’ll learn the jargon, language history, and best practices from a Python developer’s perspective.
Topics:
Topic Links:
Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
What goes into creating those enhanced error messages in the latest versions of Python? How does the new PEG parser help to pinpoint where errors have occurred? This week on the show, Pablo Galindo Salgado talks about the work that goes into creating these improvements.
Pablo is a core CPython developer and is the release manager for Python versions 3.10 and 3.11. He is also serving his second term on the Python Steering Council.
Pablo is pleasantly surprised by the positive feedback for the new error messages in Python 3.10. He shares some of the upcoming enhancements for 3.11. We talk about how the new PEG parser allows for greater context when defining errors and pinpointing where they occur.
We talk about how he started contributing to CPython. He also shares some of the programming experiences he had while studying physics at university.
Course Spotlight: Starting With Linear Regression in Python
In this video course, you’ll get started with linear regression in Python. Linear regression is one of the fundamental statistical and machine learning techniques, and Python is a popular choice for machine learning.
Topics:
try
… except
blockShow Links:
Level up your Python skills with our expert-led courses:
Do you understand how a hash table works? What if you could learn about building one while practicing test-driven development? What are best practices when designing a REST API? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects.
We talk about the recent Real Python article “Build a Hash Table in Python With TDD.” The tutorial shows how to implement a hash table prototype from scratch in Python. It also provides a hands-on crash course in test-driven development.
Christopher shares an article on designing REST APIs and provides some of his own best practices. We cover authentication implementation, good naming conventions, versioned APIs, and ways to specify dates.
We cover several other articles and projects from the Python community, including a news roundup, a PEP on removing dead batteries from the standard library, a comparison of the Python list vs tuple, a guide to writing user-friendly CLIs in Python, just enough Cython to be useful, a cross-platform TUI and ASCII animation package, and code for running black
on Python code blocks in documentation files.
Course Spotlight: Command Line Interfaces in Python
Command-line arguments are the key to converting your programs into useful and enticing tools that are ready to be used in the terminal of your operating system. In this course, you’ll learn their origins, standards, and basics, and how to implement them in your program.
Topics:
News:
Topic Links:
list
and tuple
are similar and how they’re different, including storage and speed differences and how to choose between them.argparse
, Click
, Typer
, Docopt
, and Fire
.Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Do you wonder if you’re taking the right approach when shaping data in pandas? Is your Jupyter workflow getting out of hand? This week on the show, Matt Harrison talks about his new book, “Effective Pandas: Patterns for Data Manipulation.”
Matt discusses working as a corporate consultant and migrating Excel users toward Python. We explore several “NumPy-isms” that beginners get stuck on. Matt shares advice about chaining operations in pandas, which some developers find controversial.
Course Spotlight: Sorting Data in Python With Pandas
In this video course, you’ll learn how to sort data in a pandas DataFrame using the pandas sort functions sort_values()
and sort_index()
. You’ll learn how to sort by one or more columns and by index in ascending or descending order.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like to build visualizations that allow your audience to play with data? How do you effectively use Python’s assert statement during development? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects.
We talk about an article that shows how to build interactive visualizations with pandas, seaborn, and ipywidgets. These widgets allow you to add sliders, buttons, and dropdown menus to your Jupyter Notebooks.
Christopher shares the Real Python article “Python’s assert: Debug and Test Your Code Like a Pro”. It covers how to use assert
statements to document, debug, and test code while in development.
We cover several other articles and projects from the Python community, including a news roundup, code review guidelines for data science teams, a project to manage your to-do lists using Python and Django, a Python 4 dream list, a static site generator based on Django, and a book of practical Python projects.
Course Spotlight: Building a Neural Network & Making Predictions With Python AI
In this step-by-step course, you’ll build a neural network from scratch as an introduction to the world of artificial intelligence (AI) in Python. You’ll learn how to train your neural network and make predictions based on a given dataset.
Topics:
News:
Topic Links:
assert
statement to document, debug, and test code in development.Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
There are many ways to get Python installed on your computer. If you were going to start fresh, what tools would you use? What if you need to manage multiple versions of Python and virtual environments? What about all the additional tools that make your coding workflow complete? This week on the show, Calvin Hendryx-Parker is here to talk about bootstrapping your Python environment.
Calvin is the co-founder and CTO of Six Feet Up and a Python Web Conference co-organizer. As a consultant, Calvin has set up countless machines to run Python. He configures environments that can scale from in-office projects to distributed cloud-based applications.
We cover tools for installing Python, managing multiple language versions, and configuring virtual environments. Calvin talks about setting up command-line applications in isolated environments. We also discuss traveling with Python on an iPad.
Course Spotlight: Start Managing Multiple Python Versions With pyenv
In this step-by-step course, you’ll learn how to install multiple Python versions and switch between them, including project-specific virtual environments, with ease with pyenv.
Topics:
requirements.txt
files and moving from pipenv to piptoolsShow Links:
Level up your Python skills with our expert-led courses:
How do you define Python functions that accept optional arguments or default values? Are you wondering how to go beyond being a beginner with Python? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects.
Christopher shares a Real Python article, “Defining Python Functions With Optional Arguments.” We talk about function flexibility, specifying default values, and using args
& kwargs
.
We discuss resources for a Python beginner to move beyond the basics and become more competent. Both of us share our experiences moving past these hurdles.
We cover several other articles and projects from the Python community, including a news roundup, ten tools you may have wished you knew when you started working with Python, Python’s zipfile
for manipulating your zip files efficiently, how one company optimized Python API server code by 100x, a dependency-free Python library for downloading YouTube videos, and how to use Python on the command line with other shell commands.
Course Spotlight: Defining Python Functions With Optional Arguments
In this video course, you’ll learn about Python optional arguments and how to define functions with default values. You’ll also learn how to create functions that accept any number of arguments using args and kwargs.
Topics:
News:
TypeVar
-based approach specified in PEP 484 but is more concise and easier to follow. Related Twitter thread by core dev Raymond Hettinger.Topics:
*args
and **kwargs
.Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Have you thought about what authentication system you want to use for your Python project? Should you use an existing Python library or a third-party service? This week on the show, Dan Moore is here to talk about authentication systems and OAuth 2.
Dan is the head of developer relations at FusionAuth. He shares advice about setting up an authentication system, setting up device grants, using social login, and addressing privacy issues. Dan also provides multiple resources to learn much more about the topic.
Course Spotlight: Using Google Login With Flask
In this course, you’ll create a Flask application that lets users sign in using their Google login. You’ll learn about OAuth 2 and OpenID Connect and also find out how to implement some code to handle user session management.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Have you been wanting to explore fractals and complex numbers in Python? Would you like to practice working with APIs in Python through a new project? This week on the show, Christopher Trudeau is here, and he’s taking on the task of curating new issues of PyCoder’s Weekly going forward. He’ll be joining me as a cohost every other week and bringing a fresh batch of PyCoder’s Weekly articles and projects.
We discuss a Real Python article about drawing the Mandelbrot set in Python. The tutorial guides you through creating fractal art using Matplotlib and Pillow. We also share a new step-by-step project building a weather-reporting command-line interface (CLI) app.
We cover several other articles and projects from the Python community, including a news roundup, a better Pygame main loop, ways to work with static and media files in Django, and a library for pleasing console output.
Course Spotlight: Make a 2D Side-Scroller Game With Pygame
In this step-by-step course, you’ll learn how to use Pygame. This library allows you to create games and rich multimedia programs in Python. You’ll learn how to draw items on your screen, implement collision detection, handle user input, and much more!
Topics:
News:
debug
template tag and a denial-of-service possibility in file uploads.Articles:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
How often have you thought about your Developer Experience (DX)? How do you improve your workflow, find documentation, and simplify code formatting? This week on the show, Adam Johnson is here to talk about his new book, “Boost Your Django DX.”
Adam provides advice on improving your developer experience, specifically inside Django and within Python. We discuss tools to simplify code formatting and linting.
Adam shares a couple of his own Django tools designed to simplify development and keep your projects updated. He also covers documentation resources for finding answers quickly.
Course Spotlight: Django View Authorization: Restricting Access
This course covers how to restrict your web pages to users with different roles through Django view authorization. You’ll learn about HttpRequest.user
objects, decorators that authenticate views, and ways to notify your users with the Django messages framework.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like to experiment with analyzing or manipulating audio with Python? This week on the show, we have Braden Riggs from DolbyIO to discuss extracting audio features and Python libraries for reshaping audio. Braden shares techniques from his recent talk at PyData Global, “Unlocking More From Your Audio Data!”
We share several articles, tutorials, and Python libraries to get you started working with audio. We begin with a quick introduction to audio digitization and feature extraction. After discussing modifying audio files, we share tools and techniques for exploring audio analysis through data science.
Braden talks about speech-to-text conversion, sentiment analysis, and Natural Language Toolkit (NLTK). He also shares a valuable collection of audio technology resources for developers.
Course Spotlight: Playing and Recording Sound in Python
In this course, you’ll learn about libraries that can be used for playing and recording sound in Python, such as PyAudio and python-sounddevice. You’ll also see code snippets for playing and recording sound files and arrays, as well as for converting between different sound file formats.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
How can you can speed up Python? Have you thought of using a JIT (Just-In-Time Compiler)? This week on the show, we have Real Python author and previous guest Anthony Shaw to talk about his project Pyjion, a drop-in JIT compiler for CPython 3.10.
Anthony has been working on Pyjion over the past year and recently released version 1.0. He talks about how he took over the project from Brett Cannon and Dino Viehland. He covers the background on compilers and assembly that he needed to take on this project.
We discuss where a tool like this can speed up your Python code, and we consider alternative solutions. We also talk about his desire to make the project as deeply compatible with Python code as possible.
Anthony talks about how his dive into writing the CPython Internals book led him into the project. We talk about what type of developer would benefit from exploring the book.
We also cover his recent Real Python article, titled “Advanced Visual Studio Code for Python Developers.” It’s an excellent resource that VS Code users should bookmark to revisit as they grow with the tool.
Spotlight: CPython Internals Book: Your Guided Tour Through the Python 3 Interpreter
Unlock the inner workings of the Python language, compile the Python interpreter from source code, and participate in the development of CPython.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Are you looking for a project to practice your Django skills? Designing the fundamental interactions of a social network is an instructive way to explore models and relationships while learning advanced Django skills. This week on the show, we talk with previous guest Martin Breuss about his new four-part series, “Build a Social Network With Django”.
Martin talks about the design process and ways to include user-focused features. He shares a handy CSS library to make your front end look modern with minimal effort.
We digress into a discussion of personal vs professional use of social networks. We also talk about the additional Real Python resources to help you build out the rest of your project.
Course Spotlight: How to Set Up a Django Project
In this course, you’ll learn the necessary steps that you’ll need to take to set up a new Django project. You’ll learn the basic setup for any new Django project, which needs to happen before programming the specific functionality of your project.
Topics:
Show Links:
Level up your Python skills with our expert-led courses:
Would you like a simple command to launch your Python programs using the newest version of the language installed on your machine? This week on the show, we continue our conversation with Brett Cannon. Brett discusses his project, the Python Launcher for Unix.
We dive into Brett’s workflow to set up projects, virtual environments, and prepare for distribution. He shares some of the tools he employs and reasons for keeping things simple.
We also talk about PEP 665, which specifies a file format to list an application’s Python package installation requirements. Brett shares why he co-authored the PEP and a bit of the community’s reaction. It leads to a deeper conversation about going beyond ‘requirements.txt’ to lock files.
Course Spotlight: Data Visualization Interfaces in Python With Dash
In this course, you’ll learn how to build a dashboard using Python and Dash. Dash is a framework for building data visualization interfaces. It helps data scientists build fully interactive web applications quickly.
Topics:
Show Links:
Level up your Python skills with our expert-led courses: