<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Real Python</title>
  <link href="https://realpython.com/atom.xml" rel="self"/>
  <link href="https://realpython.com/"/>
  <updated>2026-10-27T14:00:00+00:00</updated>
  <id>https://realpython.com/</id>
  <author>
    <name>Real Python</name>
  </author>

  
    <entry>
      <title>Python Circular Imports: Why They Happen and How to Fix Them</title>
      <id>https://realpython.com/python-circular-imports/</id>
      <link href="https://realpython.com/python-circular-imports/"/>
      <updated>2026-10-27T14:00:00+00:00</updated>
      <summary>Confused by Python circular imports? Learn why they happen, how Python&#x27;s import system works, and how to fix import errors using practical examples.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;A Python circular import happens when two modules import each other and one of them isn’t finished loading yet. Python reports it as an &lt;code&gt;ImportError&lt;/code&gt; or an &lt;code&gt;AttributeError&lt;/code&gt;, usually with a message about a partially initialized module. In this tutorial, you’ll trace what Python does when that happens, then work through fixes ranging from removing the dependency to using workarounds.&lt;/p&gt;
&lt;p&gt;To follow along, you should be comfortable with &lt;a href=&quot;https://realpython.com/python-modules-packages/&quot;&gt;modules and packages&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt;, and basic &lt;a href=&quot;https://realpython.com/python-type-checking/&quot;&gt;type hints&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;Python circular import&lt;/strong&gt; happens when two modules depend on each other and one asks for a name before the other has finished loading.&lt;/li&gt;
&lt;li&gt;The reliable fix is to &lt;strong&gt;remove the dependency&lt;/strong&gt; so that imports flow in one direction.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ImportError&lt;/code&gt; and &lt;code&gt;AttributeError&lt;/code&gt; signal the same cycle, and which one you get depends on the &lt;strong&gt;form&lt;/strong&gt; of the import statement you used.&lt;/li&gt;
&lt;li&gt;Moving an import &lt;strong&gt;inside the function&lt;/strong&gt; that needs it is the only workaround that survives any import order.&lt;/li&gt;
&lt;li&gt;A type-only import still needs a &lt;strong&gt;&lt;code&gt;TYPE_CHECKING&lt;/code&gt; guard&lt;/strong&gt;, even on Python 3.14, where annotations are evaluated lazily.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To see why the error occurs where it does, you’ll start with the import machinery itself, then build a small project that reproduces the problem.&lt;/p&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Python Circular Imports: Why They Happen and How to Fix Them” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-circular-imports/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe0e6;&quot; alt=&quot;A person in goggles uses a snake tong on one of two snakes biting each other&#x27;s tails in a loop around a Python logo, next to a computer console labeled Shared.&quot; src=&quot;https://files.realpython.com/media/Python-Circular-Imports-Why-They-Happen-and-How-to-Fix-Them_Watermarked.867b8e8d19ea.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-Circular-Imports-Why-They-Happen-and-How-to-Fix-Them_Watermarked.867b8e8d19ea.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-Circular-Imports-Why-They-Happen-and-How-to-Fix-Them_Watermarked.867b8e8d19ea.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-Circular-Imports-Why-They-Happen-and-How-to-Fix-Them_Watermarked.867b8e8d19ea.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-Circular-Imports-Why-They-Happen-and-How-to-Fix-Them_Watermarked.867b8e8d19ea.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-circular-imports/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Python Circular Imports: Why They Happen and How to Fix Them&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of Python circular imports, from how the import system loads modules to the fixes and workarounds that break a cycle.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;in-short-a-python-circular-import-is-a-loop-between-modules&quot;&gt;In Short: A Python Circular Import Is a Loop Between Modules&lt;a class=&quot;headerlink&quot; href=&quot;#in-short-a-python-circular-import-is-a-loop-between-modules&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A circular import happens when two or more &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;modules&lt;/a&gt; import each other, directly or through a chain. The cycle fails only when one module asks for a name that the other module hasn’t defined yet, because Python is still loading that module. You’ll see this as an &lt;a href=&quot;/ref/builtin-exceptions/importerror/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;ImportError&lt;/code&gt;&lt;/a&gt; or an &lt;a href=&quot;/ref/builtin-exceptions/attributeerror/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;AttributeError&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The reliable fix is to restructure your code so &lt;a href=&quot;/ref/best-practices/imports/&quot; class=&quot;ref-link&quot;&gt;imports&lt;/a&gt; flow in one direction, toward the module that could exist without the other. Guard imports used only for type hints with &lt;code&gt;TYPE_CHECKING&lt;/code&gt;. If you can’t restructure yet, move the import inside the function that needs it.&lt;/p&gt;
&lt;h2 id=&quot;why-python-circular-imports-fail&quot;&gt;Why Python Circular Imports Fail&lt;a class=&quot;headerlink&quot; href=&quot;#why-python-circular-imports-fail&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To understand why circular imports happen, you first need to know how &lt;a href=&quot;https://realpython.com/python-import/&quot;&gt;Python imports modules&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Whenever Python imports a module, it first creates an entry for that module in &lt;a href=&quot;https://docs.python.org/3/library/sys.html#sys.modules&quot;&gt;&lt;code&gt;sys.modules&lt;/code&gt;&lt;/a&gt;. It then starts executing the file from top to bottom.&lt;/p&gt;
&lt;p&gt;Think of &lt;code&gt;sys.modules&lt;/code&gt; as Python’s cache of imported modules. If another import requests a module that’s already in the cache, Python reuses the existing module object instead of importing it again.&lt;/p&gt;
&lt;p&gt;The key is that Python adds the module to &lt;code&gt;sys.modules&lt;/code&gt; before it finishes executing the file. That means the module can exist in a partially initialized state. Some &lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;functions&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-classes/&quot;&gt;classes&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variables&lt;/a&gt; may not exist yet because Python hasn’t reached those lines of code. If another module tries to import one of those objects before it’s defined, Python raises an &lt;code&gt;ImportError&lt;/code&gt; or &lt;code&gt;AttributeError&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&quot;a-python-circular-import-example&quot;&gt;A Python Circular Import Example&lt;a class=&quot;headerlink&quot; href=&quot;#a-python-circular-import-example&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Suppose you’re building a Python application to manage orders for an e-commerce store. You’ll build it as a &lt;code&gt;shop&lt;/code&gt; package with a &lt;code&gt;main.py&lt;/code&gt; script beside it:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;shop_project/
│
├── shop/
│   ├── __init__.py
│   ├── order.py
│   └── product.py
│
└── main.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The empty &lt;a href=&quot;https://realpython.com/python-init-py/&quot;&gt;&lt;code&gt;__init__.py&lt;/code&gt;&lt;/a&gt; makes &lt;code&gt;shop&lt;/code&gt; a regular package. You can run the examples without it, but type checkers need it to work out that &lt;code&gt;shop.order&lt;/code&gt; and &lt;code&gt;shop.product&lt;/code&gt; belong together.&lt;/p&gt;
&lt;p&gt;The package also keeps the error message accurate. From Python 3.13, if the failing module sits in the same folder as the script you run, Python suggests renaming the file instead of reporting the circular import. Keeping the modules inside &lt;code&gt;shop/&lt;/code&gt; avoids that misleading hint.&lt;/p&gt;
&lt;p&gt;Every stage of this tutorial is a complete, runnable version of this project. The examples target Python 3.14, and the tutorial points out where older versions behave differently. You can download every stage here:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-circular-imports-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-python-circular-imports-code&quot; markdown&gt;Click here to download the free sample code&lt;/a&gt; you’ll use to learn how circular imports break and how to fix them.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You have an &lt;code&gt;Order&lt;/code&gt; class that tracks the product you order and any additional items you add. Since it works with &lt;code&gt;Product&lt;/code&gt; objects, &lt;code&gt;order.py&lt;/code&gt; imports the &lt;code&gt;Product&lt;/code&gt; class:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    &lt;span class=&quot;me-2&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Filename: &lt;/span&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;shop/order.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;shop.product&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Product&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;SHIPPING_FEE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mf&quot;&gt;4.99&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;fm&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Product&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;product&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;product&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extras&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;list&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Product&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_shipping&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extras&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Product&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Shipping&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SHIPPING_FEE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;get_total&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;subtotal&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;price&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;subtotal&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extra&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;price&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;extra&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extras&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Now look at &lt;code&gt;product.py&lt;/code&gt;. Its &lt;code&gt;order()&lt;/code&gt; &lt;a href=&quot;/ref/glossary/method/&quot; class=&quot;ref-link&quot;&gt;method&lt;/a&gt; creates an &lt;code&gt;Order&lt;/code&gt; object, and &lt;code&gt;is_in_order()&lt;/code&gt; accepts an &lt;code&gt;Order&lt;/code&gt; object to check whether the product belongs to that order. So &lt;code&gt;product.py&lt;/code&gt; imports the &lt;code&gt;Order&lt;/code&gt; class from &lt;code&gt;order.py&lt;/code&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    &lt;span class=&quot;me-2&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Filename: &lt;/span&gt;&lt;code style=&quot;color: inherit; background: inherit;&quot;&gt;shop/product.py&lt;/code&gt;&lt;/span&gt;
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;shop.order&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Order&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Product&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;fm&quot;&gt;__init__&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;price&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;
        &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;price&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;price&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;quantity&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;is_in_order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bool&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;product&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-circular-imports/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-circular-imports/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Get Out of Tutorial Hell</title>
      <id>https://realpython.com/how-to-get-out-of-tutorial-hell/</id>
      <link href="https://realpython.com/how-to-get-out-of-tutorial-hell/"/>
      <updated>2026-10-27T14:00:00+00:00</updated>
      <summary>Stuck in tutorial hell? Learn how to get out by turning Python tutorials into practical projects that build real skills and lasting confidence.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Tutorial hell is an unfortunate reality for many newcomers to Python, and learning how to get out of it starts with understanding why it’s so easy to fall into. When you’re a beginner, finishing tutorials is addictive! They make learning Python approachable by giving you a clear problem, showing you the steps to solve it, and letting you know when you’re finished. This structure is incredibly useful and fun when you’re just starting out.&lt;/p&gt;
&lt;p&gt;After a while, that rush begins to fade as you notice something frustrating: you can follow tutorials successfully but still feel lost when you open a blank editor and no one tells you what comes next.&lt;/p&gt;
&lt;p&gt;Instead of sitting with this discomfort, you start yet another tutorial, and the cycle known as &lt;strong&gt;tutorial hell&lt;/strong&gt; begins. You keep learning new concepts, but you never practice making the decisions programmers have to make on their own.&lt;/p&gt;
&lt;p&gt;The problem isn’t the tutorials. Even a great tutorial can tell you exactly what to build and why, but it can’t give you the experience of working that out yourself: building something, hitting a wall, and figuring out what was missing.&lt;/p&gt;
&lt;p&gt;In this guide, you’ll learn which skills tutorials leave out and explore practical ways to develop them on your own.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this guide, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Tutorials &lt;strong&gt;deliberately narrow a problem&lt;/strong&gt; so you can focus on one topic, which is why they’re useful and also why they can’t be your only practice.&lt;/li&gt;
&lt;li&gt;Following a tutorial rarely lets you practice &lt;strong&gt;specifying the real problem&lt;/strong&gt;, &lt;strong&gt;making tradeoffs&lt;/strong&gt;, &lt;strong&gt;identifying knowledge gaps&lt;/strong&gt;, or &lt;strong&gt;knowing when you’re done&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Analyzing a tutorial you’ve completed&lt;/strong&gt; and &lt;strong&gt;writing your own tutorials&lt;/strong&gt; let you practice those skills in a low-stakes setting.&lt;/li&gt;
&lt;li&gt;Your own projects expose gaps that send you back to tutorials, and that &lt;strong&gt;learning cycle&lt;/strong&gt; continues throughout your career.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Experienced programmers move around this cycle constantly. The goal isn’t to leave tutorials behind but to keep moving instead of getting stuck at the first step:&lt;/p&gt;
&lt;figure class=&quot;&quot;&gt;&lt;img loading=&quot;lazy&quot; class=&quot;img-fluid mx-auto d-block &quot; src=&quot;https://files.realpython.com/media/graphic-tutorial-hell-learning-cycle.a403557dfc80.svg&quot; width=&quot;700&quot; height=&quot;500&quot; alt=&quot;A clockwise loop from learning with a tutorial, to building your own project, to hitting a gap that sends you back to a tutorial.&quot; data-asset=&quot;7444&quot;&gt;&lt;figcaption class=&quot;figure-caption text-center&quot;&gt;Tutorials as a Step in an Ongoing Learning Cycle&lt;/figcaption&gt;&lt;/figure&gt;

&lt;p&gt;To work through the exercises in this guide, download the &lt;strong&gt;Tutorial-to-Project Worksheet&lt;/strong&gt;, which includes a completed example, by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Worksheet:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/get-out-of-tutorial-hell-worksheet/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-get-out-of-tutorial-hell-worksheet&quot; markdown&gt;Click here to download&lt;/a&gt; a free Tutorial-to-Project Worksheet, with a completed example, that helps you turn the tutorials you’ve finished into projects of your own.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “How to Get Out of Tutorial Hell” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/how-to-get-out-of-tutorial-hell/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #fe7e73;&quot; alt=&quot;A person at a laptop giving a thumbs-up beside a checked-off skills board, next to a looping conveyor machine labeled Tutorials stacked with numbered boxes.&quot; src=&quot;https://files.realpython.com/media/How-to-Get-Out-of-Tutorial-Hell-Turn-Python-Tutorials-into-Practical-Projects_Watermarked.347421aa59d3.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/How-to-Get-Out-of-Tutorial-Hell-Turn-Python-Tutorials-into-Practical-Projects_Watermarked.347421aa59d3.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/How-to-Get-Out-of-Tutorial-Hell-Turn-Python-Tutorials-into-Practical-Projects_Watermarked.347421aa59d3.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/How-to-Get-Out-of-Tutorial-Hell-Turn-Python-Tutorials-into-Practical-Projects_Watermarked.347421aa59d3.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/How-to-Get-Out-of-Tutorial-Hell-Turn-Python-Tutorials-into-Practical-Projects_Watermarked.347421aa59d3.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/how-to-get-out-of-tutorial-hell/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;How to Get Out of Tutorial Hell&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test how well you can turn Python tutorials into practical projects by specifying problems, weighing tradeoffs, and knowing when you&#x27;re done.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;prerequisites&quot;&gt;Prerequisites&lt;a class=&quot;headerlink&quot; href=&quot;#prerequisites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This guide is for you if you’ve completed a few Python tutorials and feel comfortable with the basics, such as &lt;a href=&quot;/ref/glossary/variable/&quot; class=&quot;ref-link&quot;&gt;variables&lt;/a&gt;, &lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;functions&lt;/a&gt;, and &lt;a href=&quot;/ref/glossary/loop/&quot; class=&quot;ref-link&quot;&gt;loops&lt;/a&gt;, but still feel stuck when you open a blank editor. There’s no code to run and nothing to install.&lt;/p&gt;
&lt;p&gt;One section uses a NumPy tutorial as a worked example, but you don’t need to know &lt;a href=&quot;https://realpython.com/numpy-tutorial/&quot;&gt;NumPy&lt;/a&gt; to follow along. Having a recent tutorial of your own in mind will help you get the most out of the exercises.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Python for Beginners Live Course:&lt;/strong&gt; Want help crossing from tutorials to projects of your own? In Real Python’s &lt;a href=&quot;https://realpython.com/workshops/python-for-beginners/&quot;&gt;Python for Beginners&lt;/a&gt; live course, you build programs from your own ideas with an instructor and a small cohort, with feedback whenever you get stuck. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;skills-you-need-beyond-tutorials&quot;&gt;Skills You Need Beyond Tutorials&lt;a class=&quot;headerlink&quot; href=&quot;#skills-you-need-beyond-tutorials&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The problem with getting stuck in tutorial hell is that tutorials aren’t meant to develop your general programming skills. Tutorials are most useful for teaching one specific topic, and they necessarily limit the scope of the problems you solve so you can focus on the skill you’re learning.&lt;/p&gt;
&lt;p&gt;However, to get better at tackling complex and ambiguous problems, you need to develop several general skills:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Specifying the real problem to be solved&lt;/li&gt;
&lt;li&gt;Making tradeoffs&lt;/li&gt;
&lt;li&gt;Identifying gaps in your knowledge&lt;/li&gt;
&lt;li&gt;Knowing when you’re done&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To illustrate these skills, consider a hypothetical situation. Suppose you’re working on a &lt;a href=&quot;https://realpython.com/django-todo-lists/&quot;&gt;to-do web application&lt;/a&gt; that lets users list their tasks for the day and check them off as they complete them. Several users ask to upload a &lt;a href=&quot;/ref/glossary/text-file/&quot; class=&quot;ref-link&quot;&gt;text file&lt;/a&gt; containing a list of to-do items and have the application automatically parse it into items in the web app.&lt;/p&gt;
&lt;p&gt;Since the users requesting this new feature likely don’t know much about programming, you have to make &lt;em&gt;all&lt;/em&gt; the decisions about how to implement it. Consider how the general skills listed above apply to this hypothetical situation.&lt;/p&gt;
&lt;h3 id=&quot;specifying-the-real-problem&quot;&gt;Specifying the Real Problem&lt;a class=&quot;headerlink&quot; href=&quot;#specifying-the-real-problem&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In a tutorial, the problem you’re trying to solve is static and clearly defined. In commercial software development, requirements are rarely so clear, so you need to develop your ability to figure out the &lt;em&gt;real&lt;/em&gt; problem you’re trying to solve.&lt;/p&gt;
&lt;p&gt;In the hypothetical example, users are asking for a way to upload text files into your web application and have each line appear as a to-do item instead of typing out the items. Before you build that, it’s worth asking &lt;em&gt;why&lt;/em&gt; they want it. Where do their task lists come from in the first place? A few users might say they keep a running list in a notes app, while others export tasks from a spreadsheet their team shares.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/how-to-get-out-of-tutorial-hell/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/how-to-get-out-of-tutorial-hell/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Pyrefly: A Fast Static Type Checker for Python Projects</title>
      <id>https://realpython.com/pyrefly-python/</id>
      <link href="https://realpython.com/pyrefly-python/"/>
      <updated>2026-10-27T14:00:00+00:00</updated>
      <summary>Learn how to use Pyrefly, a fast static type checker for Python, to catch type errors, generate type annotations, and measure type coverage.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Pyrefly is a fast static type checker for Python that helps you catch type-related issues before running your code. It also includes features for generating type hints and measuring type coverage across a codebase.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll use Pyrefly to catch type errors, add type hints to existing code, track your project’s type coverage, and see how its speed compares. You’ll get the most out of it if you’re comfortable writing functions and adding basic &lt;a href=&quot;https://realpython.com/python-type-checking/&quot;&gt;type hints&lt;/a&gt; in Python 3.10 or later. The table below gives you a quick comparison with two popular alternatives, &lt;a href=&quot;https://microsoft.github.io/pyright/&quot;&gt;Pyright&lt;/a&gt; and &lt;a href=&quot;/ref/tools/mypy/&quot; class=&quot;ref-link&quot;&gt;mypy&lt;/a&gt;:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Pyrefly&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Pyright&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;mypy&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Type checking&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Type-hint generation&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Type coverage&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Fast&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The table highlights where the Pyrefly CLI goes beyond other tools: it can generate type hints and measure coverage, and it’s built to be &lt;em&gt;very&lt;/em&gt; fast. The coverage comparison needs context: Pyright’s &lt;code&gt;--verifytypes&lt;/code&gt; checks a package’s public interface, while mypy’s reporting flags can summarize how much of your code has type hints.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/pyrefly-python-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-pyrefly-python-code&quot; markdown&gt;Click here to download the free example project&lt;/a&gt; you’ll use to catch type errors, generate type hints, and measure type coverage with Pyrefly.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Pyrefly: A Fast Static Type Checker for Python Projects” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/pyrefly-python/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #b9abe6;&quot; alt=&quot;A glowing bee highlights a line on a long printout from a machine with Checking, Inferring, and Coverage gauges, while a person with a clipboard points at it.&quot; src=&quot;https://files.realpython.com/media/Pyrefly_Watermarked.e01515b88827.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Pyrefly_Watermarked.e01515b88827.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Pyrefly_Watermarked.e01515b88827.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Pyrefly_Watermarked.e01515b88827.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Pyrefly_Watermarked.e01515b88827.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/pyrefly-python/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Pyrefly: A Fast Static Type Checker for Python Projects&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of Pyrefly, a fast Python type checker, from catching type errors to generating type hints and measuring type coverage.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;get-started-with-pyrefly&quot;&gt;Get Started With Pyrefly&lt;a class=&quot;headerlink&quot; href=&quot;#get-started-with-pyrefly&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://pyrefly.org/&quot;&gt;Pyrefly&lt;/a&gt; is available on &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;PyPI&lt;/a&gt;. To follow along, first create and activate a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;, then install Pyrefly with &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;mkdir&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pyrefly-demo
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pyrefly-demo
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;.venv
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;.venv/bin/activate
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;pyrefly&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;.2.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Note that on Windows, you’ll need to activate the environment with &lt;code&gt;.venv\Scripts\activate&lt;/code&gt; instead.&lt;/p&gt;
&lt;p&gt;One of the quickest ways to try Pyrefly is with &lt;code&gt;pyrefly snippet&lt;/code&gt;, which type-checks a short piece of Python code without creating a file. The following snippet hints &lt;code&gt;x&lt;/code&gt; as a &lt;a href=&quot;https://realpython.com/python-strings/&quot;&gt;string&lt;/a&gt; but &lt;a href=&quot;/ref/glossary/assignment/&quot; class=&quot;ref-link&quot;&gt;assigns&lt;/a&gt; it an integer:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;pyrefly&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;snippet&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;x: str = 1&quot;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;ERROR `Literal[1]` is not assignable to `str` [bad-assignment]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; --&amp;gt; snippet:1:10&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  |&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;1 | x: str = 1&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  |    ---   ^&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  |    |&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  |    declared type&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;  |&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; INFO 1 error&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Pyrefly reports an error because the &lt;a href=&quot;https://realpython.com/python-variables/&quot;&gt;variable&lt;/a&gt; &lt;code&gt;x&lt;/code&gt; is hinted as &lt;code&gt;str&lt;/code&gt;, but the assigned value is an &lt;a href=&quot;/ref/builtin-types/int/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;int&lt;/code&gt;&lt;/a&gt;. The error shows it as &lt;code&gt;Literal[1]&lt;/code&gt;, the most specific type Pyrefly can infer for &lt;code&gt;1&lt;/code&gt;. Assigning a value of the correct type removes the error:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;pyrefly&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;snippet&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&#x27;x: str = &quot;Hello, World!&quot;&#x27;&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; INFO 0 errors&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Like other type-checking tools, Pyrefly checks your code against its &lt;a href=&quot;/ref/glossary/type-hint/&quot; class=&quot;ref-link&quot;&gt;type hints&lt;/a&gt; without executing it. As your projects grow, this can help you catch type-related issues before they become runtime bugs.&lt;/p&gt;
&lt;p&gt;In addition to being a &lt;a href=&quot;/ref/glossary/command-line-interface/&quot; class=&quot;ref-link&quot;&gt;command-line&lt;/a&gt; tool for type-checking your code, Pyrefly includes a language server for editor integration. This tutorial focuses on the command-line workflow, but you can find setup &lt;a href=&quot;https://pyrefly.org/en/docs/IDE/&quot;&gt;instructions for popular editors&lt;/a&gt; in the official documentation.&lt;/p&gt;
&lt;h2 id=&quot;catch-type-errors-in-a-python-project-before-execution&quot;&gt;Catch Type Errors in a Python Project Before Execution&lt;a class=&quot;headerlink&quot; href=&quot;#catch-type-errors-in-a-python-project-before-execution&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;While &lt;code&gt;pyrefly snippet&lt;/code&gt; is useful for quickly checking a small piece of code, most type checking happens across modules, &lt;a href=&quot;/ref/glossary/package/&quot; class=&quot;ref-link&quot;&gt;packages&lt;/a&gt;, and even entire projects. You can use Pyrefly to analyze Python files in a codebase with &lt;code&gt;pyrefly check&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;First, initialize Pyrefly in your project folder. The &lt;code&gt;--non-interactive&lt;/code&gt; flag accepts the default settings instead of prompting you for each one:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;pyrefly&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;init&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;--non-interactive
&lt;span class=&quot;go&quot;&gt; INFO New config written to `.../pyrefly.toml`&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; INFO Running pyrefly check...&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt; ...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The command creates a &lt;code&gt;pyrefly.toml&lt;/code&gt; configuration file that instructs Pyrefly to check all Python files and &lt;a href=&quot;https://realpython.com/jupyter-notebook-introduction/&quot;&gt;Jupyter notebooks&lt;/a&gt; in the current project. You may also notice that &lt;code&gt;pyrefly init&lt;/code&gt; automatically runs a type check after creating the configuration file. Since the folder doesn’t contain any Python files yet, this first check has nothing to report, so instead, focus on the configuration file that &lt;code&gt;pyrefly init&lt;/code&gt; creates.&lt;/p&gt;
&lt;p&gt;Here’s what that file may look like:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/pyrefly-python/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/pyrefly-python/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>MCP vs API Calls: Which Should You Use for Python LLM Apps?</title>
      <id>https://realpython.com/mcp-vs-api/</id>
      <link href="https://realpython.com/mcp-vs-api/"/>
      <updated>2026-10-27T14:00:00+00:00</updated>
      <summary>MCP vs API calls: build one Python tool, integrate it both ways, and compare. Learn what each approach costs and when an MCP server pays for itself.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Anthropic open-sourced the Model Context Protocol (MCP) in November 2024 to fix a scaling problem: every new tool a model reached for needed its own integration, built on direct API calls. Building that integration today involves a decision usually framed as MCP vs API calls.&lt;/p&gt;
&lt;p&gt;One year later, more than 10,000 public MCP servers were running. ChatGPT, Gemini, Cursor, and Microsoft Copilot had all added support, and Anthropic had &lt;a href=&quot;https://www.anthropic.com/news/donating-the-model-context-protocol-and-establishing-of-the-agentic-ai-foundation&quot;&gt;donated the protocol&lt;/a&gt; to the Linux Foundation. So it’s tempting to see &lt;strong&gt;direct &lt;a href=&quot;/ref/glossary/api/&quot; class=&quot;ref-link&quot;&gt;API&lt;/a&gt; calls&lt;/strong&gt; as the old way to connect a tool and &lt;strong&gt;&lt;a href=&quot;/ref/ai-coding-glossary/mcp/&quot; class=&quot;ref-link&quot;&gt;MCP&lt;/a&gt;&lt;/strong&gt; as what comes next.&lt;/p&gt;
&lt;p&gt;With direct API calls, you describe the tool to the model provider’s API yourself, and your own function-calling code runs that tool whenever the model requests it. With MCP, you put that same tool behind a small standard server that any MCP-aware client can discover and call. To see the difference up close, you’ll build one small tool that looks up a package on PyPI and connect it to an app both ways.&lt;/p&gt;
&lt;p&gt;MCP isn’t a replacement for direct API calls, though. An MCP server typically reaches its own backends the same way, through ordinary HTTP requests. MCP adds a layer on top of those requests instead of replacing them. So the question isn’t which technology is newer. It’s whether you’ll reuse your tools beyond the app you’re writing today.&lt;/p&gt;
&lt;p&gt;If you’ve ever integrated the same tool into several apps and then kept those copies in sync by hand, then MCP targets exactly that problem. You write the tool once, and every app reuses it. If you’re shipping one app and want nothing extra to run, then the direct API call you already know is hard to beat. Here’s a quick reference to help you choose the right approach:&lt;/p&gt;
&lt;div class=&quot;table-responsive&quot;&gt;
&lt;table class=&quot;table table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Use Case&lt;/th&gt;
&lt;th class=&quot;text-center&quot;&gt;Pick MCP&lt;/th&gt;
&lt;th class=&quot;text-center&quot;&gt;Pick Direct API Calls&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;You’ll reuse the same tools across several apps or model providers&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You’re shipping one app and want zero extra infrastructure&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;—&lt;/td&gt;
&lt;td class=&quot;text-center&quot;&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The comparison sections below give the reasoning behind each row.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/mcp-vs-api-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-mcp-vs-api-code&quot; markdown&gt;Click here to download the free MCP server and client code&lt;/a&gt; that shows you how to compare MCP and direct API calls in a Python LLM app.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “MCP vs API Calls: Which Should You Use for Python LLM Apps?” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/mcp-vs-api/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe0e6;&quot; alt=&quot;A person pulling a sheet from a machine with a CALL button, gauge, and Python chip, next to a transparent box of MCP, Analysis, and Reuse modules fed by an API pipe.&quot; src=&quot;https://files.realpython.com/media/MCP-vs-API_Watermarked.67fb9e30d474.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/MCP-vs-API_Watermarked.67fb9e30d474.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/MCP-vs-API_Watermarked.67fb9e30d474.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/MCP-vs-API_Watermarked.67fb9e30d474.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/MCP-vs-API_Watermarked.67fb9e30d474.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/mcp-vs-api/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;MCP vs API Calls: Which Should You Use for Python LLM Apps?&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Test your understanding of MCP vs API calls in Python LLM apps, from tool schemas and MCP servers to when each approach pays off.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;AI Agent From Scratch Live Course:&lt;/strong&gt; Want to see how an agent decides when to call a tool? In Real Python’s &lt;a href=&quot;https://realpython.com/workshops/agentic-loops/&quot;&gt;Build an AI Agent From Scratch in Python&lt;/a&gt; live course, you build the agent loop by hand, from the model call to the tool, so you can predict what agents do. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;metrics-comparison-mcp-vs-api-calls&quot;&gt;Metrics Comparison: MCP vs API Calls&lt;a class=&quot;headerlink&quot; href=&quot;#metrics-comparison-mcp-vs-api-calls&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;MCP and direct API calls give you the same capability, so what separates them is structure and cost. A single tool call takes about the same time in both, so the comparison comes down to what each approach installs, runs, and repeats as your project grows.&lt;/p&gt;
&lt;p&gt;This comparison weighs the two approaches along four axes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Setup cost:&lt;/strong&gt; Both approaches need a client library to reach the model. MCP also needs a package that implements the protocol, plus a separate server process to run. Direct API calls need neither, because the tool runs as a plain function inside your app.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code per tool:&lt;/strong&gt; Each tool needs a &lt;em&gt;schema&lt;/em&gt;, the JSON description of its name and parameters. MCP takes a one-line registration and hands the schema back to any client that asks, while a direct API call takes a schema you write by hand.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reach:&lt;/strong&gt; An MCP server carries a tool to other model providers and to clients you didn’t write, while a direct API call hard-codes the tool inside one app.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Maturity:&lt;/strong&gt; MCP arrived in late 2024, and its specification still moves quickly, while &lt;a href=&quot;/ref/ai-coding-glossary/tool-use/&quot; class=&quot;ref-link&quot;&gt;function calling&lt;/a&gt; has been part of the major model APIs since 2023.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both approaches also need a &lt;em&gt;dispatch loop&lt;/em&gt;, the code that runs the tool the model asks for and sends the result back.&lt;/p&gt;
&lt;p&gt;The costs add up differently. You pay MCP’s setup cost once: a dependency, a server, and a registration. The server does remain one more process to run, though. The direct API call’s costs are smaller but return with every new app that needs the tool. So the more apps you build, the more MCP’s upfront cost pays for itself.&lt;/p&gt;
&lt;h2 id=&quot;feature-comparison-1-integration-effort-and-reusability&quot;&gt;Feature Comparison 1: Integration Effort and Reusability&lt;a class=&quot;headerlink&quot; href=&quot;#feature-comparison-1-integration-effort-and-reusability&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first difference between the two approaches is the work of integrating a tool and how much of that work you can reuse when the next app needs the same tool.&lt;/p&gt;
&lt;p&gt;You’ll write one Python function, &lt;code&gt;get_package_info()&lt;/code&gt;, and integrate this function into a Python LLM app two ways: once with direct API calls and once with MCP. The tool stays identical across both approaches, so the only difference is its integration in the app.&lt;/p&gt;
&lt;p&gt;Two terms are worth pinning down first. This tutorial uses &lt;em&gt;the model&lt;/em&gt; as shorthand for the &lt;a href=&quot;/ref/ai-coding-glossary/llm/&quot; class=&quot;ref-link&quot;&gt;LLM&lt;/a&gt; that your app sends questions to, and it uses &lt;em&gt;function&lt;/em&gt; and &lt;em&gt;tool&lt;/em&gt; interchangeably, because a function that the model can call is what both approaches refer to as a &lt;strong&gt;tool&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The examples use Python 3.14 with &lt;code&gt;anthropic&lt;/code&gt; 1.4.0 and &lt;code&gt;mcp&lt;/code&gt; 2.1.1, and all the code runs on Python 3.10 and later. To follow along, you should be comfortable writing Python &lt;a href=&quot;https://realpython.com/defining-your-own-python-function/&quot;&gt;functions&lt;/a&gt; and working with &lt;a href=&quot;https://realpython.com/python-dicts/&quot;&gt;dictionaries&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt;. The MCP client uses &lt;a href=&quot;/ref/keywords/async/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;async&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;/ref/keywords/await/&quot; class=&quot;ref-link&quot;&gt;&lt;code&gt;await&lt;/code&gt;&lt;/a&gt;, so a quick look at &lt;a href=&quot;https://realpython.com/async-io-python/&quot;&gt;Python’s asyncio&lt;/a&gt; will help if those are new to you.&lt;/p&gt;
&lt;p&gt;It’s a good idea to install both packages in a dedicated &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;, which keeps them from interfering with your other projects. You can create the virtual environment and install the packages with &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;venv&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;.venv
&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;.venv/bin/activate
&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;anthropic&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;.4.0&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;mcp&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;.1.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This tutorial uses the Anthropic client as an example, and that client requires an API key to work. Create a key in the &lt;a href=&quot;https://platform.claude.com/settings/keys&quot;&gt;Claude Platform&lt;/a&gt;, and then export it as an &lt;a href=&quot;/ref/computer-science-glossary/environment-variable-env-var/&quot; class=&quot;ref-link&quot;&gt;environment variable&lt;/a&gt; in your shell session so that the &lt;code&gt;anthropic&lt;/code&gt; &lt;a href=&quot;/ref/computer-science-glossary/software-development-kit/&quot; class=&quot;ref-link&quot;&gt;SDK&lt;/a&gt; can use it:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;your-api-key-here&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/mcp-vs-api/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/mcp-vs-api/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Exploring AI Coding Agent Workflows</title>
      <id>https://realpython.com/courses/exploring-ai-coding-agent-workflows/</id>
      <link href="https://realpython.com/courses/exploring-ai-coding-agent-workflows/"/>
      <updated>2026-10-27T14:00:00+00:00</updated>
      <summary>AI coding agents come in four types: IDE, terminal, PR, and cloud. Learn how each workflow fits into modern Python development.</summary>
      <content type="html">
        &lt;p&gt;AI coding agents can read your code, reason about changes, and act on your behalf. To choose the right one, it helps to understand the four common workflow types: integrated development environment (IDE), terminal, pull request (PR), and cloud.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identify&lt;/strong&gt; the four common &lt;strong&gt;agent interaction modes&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Understand&lt;/strong&gt; what makes &lt;strong&gt;each workflow distinct&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recognize&lt;/strong&gt; which mode fits &lt;strong&gt;common development scenarios&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Weigh&lt;/strong&gt; the &lt;strong&gt;risks and tradeoffs&lt;/strong&gt; of each workflow&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Whether you&amp;rsquo;re pairing with an agent in your editor or handing off whole tasks to the cloud, you&amp;rsquo;ll come away knowing how much control each workflow gives you and where it&amp;rsquo;s most likely to trip you up.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Codex Live Course:&lt;/strong&gt; Want hands-on practice with one of these workflows? In Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/codex/&quot;&gt;Codex for Python Developers&lt;/a&gt; live course, you build an entire Python project with Codex, an AI agent that works inside your codebase. The next course runs &lt;strong&gt;November 14 and 15&lt;/strong&gt;!&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: How to Get Out of Tutorial Hell</title>
      <id>https://realpython.com/quizzes/how-to-get-out-of-tutorial-hell/</id>
      <link href="https://realpython.com/quizzes/how-to-get-out-of-tutorial-hell/"/>
      <updated>2026-10-27T12:00:00+00:00</updated>
      <summary>Test how well you can turn Python tutorials into practical projects by specifying problems, weighing tradeoffs, and knowing when you&#x27;re done.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/how-to-get-out-of-tutorial-hell/&quot;&gt;How to Get Out of Tutorial Hell&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit why tutorials deliberately narrow a problem,
which general skills they leave out, and how analyzing tutorials, writing your own, and
building projects help you practice specifying problems, making tradeoffs, spotting gaps
in your knowledge, and deciding when you&amp;rsquo;re done.&lt;/p&gt;
&lt;p&gt;When you&amp;rsquo;re ready to put these skills to work, pick something to build from
&lt;a href=&quot;https://realpython.com/intermediate-python-project-ideas/&quot;&gt;13 Project Ideas for Intermediate Python Developers&lt;/a&gt;.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: MCP vs API Calls: Which Should You Use for Python LLM Apps?</title>
      <id>https://realpython.com/quizzes/mcp-vs-api/</id>
      <link href="https://realpython.com/quizzes/mcp-vs-api/"/>
      <updated>2026-10-27T12:00:00+00:00</updated>
      <summary>Test your understanding of MCP vs API calls in Python LLM apps, from tool schemas and MCP servers to when each approach pays off.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/mcp-vs-api/&quot;&gt;MCP vs API Calls: Which Should You Use for Python LLM Apps?&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how direct API calls and an MCP server each
connect the same Python tool to a model, where the tool schema comes from in each approach,
how an MCP client discovers and calls tools, and when the extra server pays for itself.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Pyrefly: A Fast Static Type Checker for Python Projects</title>
      <id>https://realpython.com/quizzes/pyrefly-python/</id>
      <link href="https://realpython.com/quizzes/pyrefly-python/"/>
      <updated>2026-10-27T12:00:00+00:00</updated>
      <summary>Test your understanding of Pyrefly, a fast Python type checker, from catching type errors to generating type hints and measuring type coverage.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/pyrefly-python/&quot;&gt;Pyrefly: A Fast Static Type Checker for Python Projects&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to catch type errors with &lt;code&gt;pyrefly check&lt;/code&gt;, generate type hints with &lt;code&gt;pyrefly infer&lt;/code&gt;, and measure type coverage with &lt;code&gt;pyrefly coverage&lt;/code&gt;. You&amp;rsquo;ll also review how Pyrefly&amp;rsquo;s speed compares with mypy and Pyright, and what to consider before you switch.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Exploring AI Coding Agent Workflows</title>
      <id>https://realpython.com/quizzes/exploring-ai-coding-agent-workflows/</id>
      <link href="https://realpython.com/quizzes/exploring-ai-coding-agent-workflows/"/>
      <updated>2026-10-27T12:00:00+00:00</updated>
      <summary>Test your understanding of IDE, terminal, PR, and cloud AI coding agents, and learn which workflow fits each development task.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/courses/exploring-ai-coding-agent-workflows/&quot;&gt;Exploring AI Coding Agent Workflows&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit the four common agent workflow types,
how coding agents loop through reading, reasoning, acting, and evaluating, and what
makes IDE, terminal, pull request, and cloud agents distinct.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also check how to match the right workflow to a task and which pitfalls to
avoid, so you can keep your code safe and stay in control of what gets merged.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python Circular Imports: Why They Happen and How to Fix Them</title>
      <id>https://realpython.com/quizzes/python-circular-imports/</id>
      <link href="https://realpython.com/quizzes/python-circular-imports/"/>
      <updated>2026-10-27T12:00:00+00:00</updated>
      <summary>Test your understanding of Python circular imports, from how the import system loads modules to the fixes and workarounds that break a cycle.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python-circular-imports/&quot;&gt;Python Circular Imports: Why They Happen and How to Fix Them&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how &lt;code&gt;sys.modules&lt;/code&gt; and partially initialized
modules lead to circular imports, how to remove a dependency and guard type-only imports
with &lt;code&gt;TYPE_CHECKING&lt;/code&gt;, and which workarounds hold up when you can&amp;rsquo;t restructure your code yet.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Use Generators and yield in Python</title>
      <id>https://realpython.com/introduction-to-python-generators/</id>
      <link href="https://realpython.com/introduction-to-python-generators/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Build generator functions and generator expressions with the Python yield statement, and learn when lazy evaluation pays off.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Have you ever had to work with a dataset so large that it overwhelmed your machine’s memory? Or maybe you have a complex &lt;a href=&quot;/ref/glossary/function/&quot; class=&quot;ref-link&quot;&gt;function&lt;/a&gt; that needs to maintain an internal state every time it’s called, but the function is too small to justify creating its own &lt;a href=&quot;/ref/glossary/class/&quot; class=&quot;ref-link&quot;&gt;class&lt;/a&gt;. In these cases and more, generators and the Python yield statement are here to help. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this article, you’ll know:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What &lt;strong&gt;generators&lt;/strong&gt; are and how to use them&lt;/li&gt;
&lt;li&gt;How to create &lt;strong&gt;generator functions and expressions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How the &lt;strong&gt;Python yield&lt;/strong&gt; statement works&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;multiple&lt;/strong&gt; Python yield statements in a generator function&lt;/li&gt;
&lt;li&gt;How to use &lt;strong&gt;advanced generator methods&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;How to &lt;strong&gt;build data pipelines&lt;/strong&gt; with multiple generators&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you’re a &lt;a href=&quot;https://realpython.com/python-beginner-tips/&quot;&gt;beginner&lt;/a&gt; or intermediate &lt;a href=&quot;/ref/glossary/pythonista/&quot; class=&quot;ref-link&quot;&gt;Pythonista&lt;/a&gt; and you’re interested in learning how to work with large datasets in a more &lt;a href=&quot;/ref/glossary/pythonic/&quot; class=&quot;ref-link&quot;&gt;Pythonic&lt;/a&gt; fashion, then this is the tutorial for you.&lt;/p&gt;
&lt;p&gt;You can get the sample code and the dataset used in this tutorial by clicking the link below:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/introduction-to-python-generators-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-introduction-to-python-generators-code&quot; markdown&gt;Click here to download the runnable generator examples&lt;/a&gt;, from reading large files to building a data pipeline with yield.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “How to Use Generators and yield in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/generators-and-yield-in-python/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe0e6;&quot; alt=&quot;How to Use Generators and Yield in Python&quot; src=&quot;https://files.realpython.com/media/Python-Generators-and-the-Yield-Keyword_Watermarked.5380262149de.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-Generators-and-the-Yield-Keyword_Watermarked.5380262149de.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-Generators-and-the-Yield-Keyword_Watermarked.5380262149de.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-Generators-and-the-Yield-Keyword_Watermarked.5380262149de.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-Generators-and-the-Yield-Keyword_Watermarked.5380262149de.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/generators-and-yield-in-python/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;How to Use Generators and yield in Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of Python generators and the yield statement. With this knowledge, you&#x27;ll be able to work with large datasets in a more Pythonic fashion, create generator functions and expressions, and build data pipelines.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Intermediate Python Deep Dive Live Course:&lt;/strong&gt; Want to keep going with iterators, generators, and data pipelines? Real Python’s &lt;a href=&quot;https://realpython.com/workshops/intermediate-deep-dive/&quot;&gt;Intermediate Python Deep Dive&lt;/a&gt; live course covers advanced iteration techniques, special methods, and Python’s object model with an instructor and a small cohort. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;using-generators&quot;&gt;Using Generators&lt;a class=&quot;headerlink&quot; href=&quot;#using-generators&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Introduced with &lt;a href=&quot;https://peps.python.org/pep-0255/&quot;&gt;PEP 255&lt;/a&gt;, &lt;strong&gt;generator functions&lt;/strong&gt; are a special kind of function that return a &lt;a href=&quot;https://en.wikipedia.org/wiki/Lazy_evaluation&quot;&gt;lazy iterator&lt;/a&gt;. These are &lt;a href=&quot;/ref/glossary/object/&quot; class=&quot;ref-link&quot;&gt;objects&lt;/a&gt; that you can loop over like a &lt;a href=&quot;https://realpython.com/python-lists-tuples/&quot;&gt;list&lt;/a&gt;. However, unlike lists, lazy iterators do not store their contents in memory. For an overview of &lt;a href=&quot;/ref/glossary/iterator/&quot; class=&quot;ref-link&quot;&gt;iterators&lt;/a&gt; in Python, take a look at &lt;a href=&quot;https://realpython.com/python-for-loop/&quot;&gt;Python “for” Loops (Definite Iteration)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now that you have a rough idea of what a generator does, you might wonder what they look like in action. Let’s take a look at two examples. In the first, you’ll see how generators work from a bird’s eye view. Then, you’ll zoom in and examine each example more thoroughly.&lt;/p&gt;
&lt;h3 id=&quot;example-1-reading-large-files&quot;&gt;Example 1: Reading Large Files&lt;a class=&quot;headerlink&quot; href=&quot;#example-1-reading-large-files&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A common use case of generators is to &lt;a href=&quot;https://realpython.com/working-with-files-in-python/&quot;&gt;work with data streams or large files&lt;/a&gt;, like &lt;a href=&quot;https://realpython.com/courses/reading-and-writing-csv-files/&quot;&gt;CSV files&lt;/a&gt;. These text files separate data into columns by using commas. This format is a common way to share data. Now, what if you want to count the number of rows in a CSV file? The code block below shows one way of counting those rows:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;csv_gen&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;csv_reader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;some_csv.txt&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;row_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;csv_gen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;row_count&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sa&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Row count is &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row_count&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;Looking at this example, you might expect &lt;code&gt;csv_gen&lt;/code&gt; to be a list. To populate this list, &lt;code&gt;csv_reader()&lt;/code&gt; opens a file and loads its contents into &lt;code&gt;csv_gen&lt;/code&gt;. Then, the program iterates over the list and increments &lt;code&gt;row_count&lt;/code&gt; for each row.&lt;/p&gt;
&lt;p&gt;This is a reasonable explanation, but would this design still work if the file is very large? What if the file is larger than the memory you have available? To answer this question, let’s assume that &lt;code&gt;csv_reader()&lt;/code&gt; just opens the file and reads it into an array:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;csv_reader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;This function opens a given file and uses &lt;code&gt;file.read()&lt;/code&gt; along with &lt;code&gt;.split()&lt;/code&gt; to add each line as a separate element to a list. If you were to use this version of &lt;code&gt;csv_reader()&lt;/code&gt; in the row counting code block you saw further up, then you’d get the following output:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gt&quot;&gt;Traceback (most recent call last):&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;ex1_naive.py&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;22&lt;/span&gt;, in &lt;span class=&quot;n&quot;&gt;&amp;lt;module&amp;gt;&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;ex1_naive.py&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;13&lt;/span&gt;, in &lt;span class=&quot;n&quot;&gt;main&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;csv_gen&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;csv_reader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;file.txt&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  File &lt;span class=&quot;nb&quot;&gt;&quot;ex1_naive.py&quot;&lt;/span&gt;, line &lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;, in &lt;span class=&quot;n&quot;&gt;csv_reader&lt;/span&gt;
&lt;span class=&quot;w&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;file&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;gr&quot;&gt;MemoryError&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;In this case, &lt;code&gt;open()&lt;/code&gt; returns a file object that you can lazily iterate through line by line. However, &lt;code&gt;file.read().split()&lt;/code&gt; loads everything into memory at once, causing the &lt;code&gt;MemoryError&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Before that happens, you’ll probably notice your computer slow to a crawl. You might even need to kill the program with a &lt;code&gt;KeyboardInterrupt&lt;/code&gt;. So, how can you handle these huge data files? Take a look at a new definition of &lt;code&gt;csv_reader()&lt;/code&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;python&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;csv_reader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;file_name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;r&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;yield&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;In this version, you open the file, iterate through it, and yield a row. This code should produce the following output, with no memory errors:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;Row count is 64186394&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;What’s happening here? Well, you’ve essentially turned &lt;code&gt;csv_reader()&lt;/code&gt; into a generator function. This version opens a file, loops through each line, and yields each row, instead of returning it.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/introduction-to-python-generators/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/introduction-to-python-generators/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>13 Project Ideas for Intermediate Python Developers</title>
      <id>https://realpython.com/intermediate-python-project-ideas/</id>
      <link href="https://realpython.com/intermediate-python-project-ideas/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Try 13 Python project ideas for intermediate developers. Build web, GUI, and command-line apps that challenge you and make you a better Pythonista.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Learning the &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;basics of Python&lt;/a&gt; is a wonderful experience. But the euphoria of just learning can be replaced by the hunger for hands-on projects. It’s normal to want to build projects, hence the need for project ideas.&lt;/p&gt;
&lt;p&gt;The problem though is that some projects are either too simple for an intermediate Python developer or too hard. This article will suggest projects you can work on as an intermediate Python developer. These project ideas will provide the appropriate level of challenge for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this article, you’ll learn:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The importance of building projects&lt;/li&gt;
&lt;li&gt;The major platforms you can build projects for&lt;/li&gt;
&lt;li&gt;Thirteen project ideas you can work on&lt;/li&gt;
&lt;li&gt;Some tips for working on projects&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;card mt-4 mb-4 bg-secondary&quot;&gt;
  &lt;p class=&quot;card-header h3 text-center bg-body-tertiary&quot;&gt;Free Bonus: &lt;strong&gt;Intermediate Python Project Ideas&lt;/strong&gt;&lt;/p&gt;
  &lt;div class=&quot;card-body&quot;&gt;
    &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row&quot;&gt;
        &lt;div class=&quot;col-xs-12 col-sm-4&quot;&gt;
          &lt;p&gt;Get a printable &lt;strong&gt;one-page PDF of all 13 project ideas&lt;/strong&gt;, with the tools to use, level-up challenges, and a worksheet to plan your next project:&lt;/p&gt;
        &lt;/div&gt;
        &lt;div class=&quot;col-xs-12 col-sm-8 text-center&quot;&gt;
          &lt;img class=&quot;img-fluid rounded mb-3 w-100&quot; src=&quot;https://files.realpython.com/media/intermediate-python-project-ideas-stacked.719dc5b2371b.png&quot; alt=&quot;Intermediate Python Project Ideas PDF&quot;&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class=&quot;row mb-3&quot;&gt;
        &lt;div class=&quot;col-12&quot;&gt;

&lt;form action=&quot;/optins/process/&quot; method=&quot;post&quot; class=&quot;mb-0&quot;&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;slug&quot; value=&quot;intermediate-python-project-ideas-pdf&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;version&quot; value=&quot;809&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;source_path&quot; value=&quot;&quot;&gt;


  &lt;div class=&quot;mb-3&quot;&gt;
    &lt;input name=&quot;email&quot; type=&quot;email&quot; class=&quot;form-control form-control-lg&quot; placeholder=&quot;Email Address&quot; aria-label=&quot;Email Address&quot; autocomplete=&quot;email&quot; required&gt;
  &lt;/div&gt;
  &lt;button name=&quot;submit&quot; type=&quot;submit&quot; class=&quot;btn btn-primary btn-lg w-100&quot;&gt;Send My Project Ideas PDF »&lt;/button&gt;

&lt;/form&gt;
&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Intermediate Python Deep Dive Live Course:&lt;/strong&gt; Want guidance as you level up from scripts to well-designed projects? Real Python’s &lt;a href=&quot;https://realpython.com/workshops/intermediate-deep-dive/&quot;&gt;Intermediate Python Deep Dive&lt;/a&gt; live course works through advanced functions, Python’s object model, and clean design with an instructor and a small cohort, with feedback on the code you write. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;the-importance-of-building-projects&quot;&gt;The Importance of Building Projects&lt;a class=&quot;headerlink&quot; href=&quot;#the-importance-of-building-projects&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Working on projects is vital to pushing your career as a Python developer forward. They make you apply the skills and knowledge you’re acquiring.&lt;/p&gt;
&lt;p&gt;Projects can help you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Build confidence&lt;/strong&gt;: You will believe more in your ability to create software regardless the level of complexity.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Explore other technologies&lt;/strong&gt;: You will learn about other technologies needed in building a complete product such as databases, servers, and other languages.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Understand programming concepts better&lt;/strong&gt;: You will learn to write code better and understand concepts such as &lt;a href=&quot;/ref/computer-science-glossary/design-pattern/&quot; class=&quot;ref-link&quot;&gt;design patterns&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Experience a complete software development life cycle&lt;/strong&gt;: You will learn how to plan before writing code, manage the coding process and update software.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is a lot to gain from building projects as a Python developer.&lt;/p&gt;
&lt;h2 id=&quot;choosing-a-project-platform&quot;&gt;Choosing a Project Platform&lt;a class=&quot;headerlink&quot; href=&quot;#choosing-a-project-platform&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You need to build your software to run on a platform so that people who lack certain technical knowledge can use your software. The web, desktop, and command-line are the three major platforms you’ll want to build your projects for.&lt;/p&gt;
&lt;h3 id=&quot;web&quot;&gt;Web&lt;a class=&quot;headerlink&quot; href=&quot;#web&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Web applications are applications that run on the web, they can be accessed on any device without being downloaded, provided there is access to the internet. If you want your projects to be accessible by everyone with internet access, it needs to be a web application.&lt;/p&gt;
&lt;p&gt;A web application has a back end and front end. The back end is the part where the business logic is: your back-end code will manipulate and store data. The front end is the interface of the application: your front-end code will determine the look of a web application.&lt;/p&gt;
&lt;p&gt;As an intermediate Python developer, your major focus will be the back-end code. However, the front-end code is important too, so you will need some knowledge of &lt;a href=&quot;https://realpython.com/html-css-python/&quot;&gt;HTML, CSS&lt;/a&gt;, and maybe &lt;a href=&quot;https://realpython.com/python-vs-javascript/&quot;&gt;JavaScript&lt;/a&gt; to create a simple-looking interface. Just the basics will be enough.&lt;/p&gt;
&lt;p&gt;Another option is to use Python for both the front end and back end. Thanks to the &lt;a href=&quot;https://anvil.works/learn&quot;&gt;&lt;code&gt;anvil&lt;/code&gt;&lt;/a&gt; library, which eliminates the need for HTML, CSS, and JavaScript, you can focus on Python code alone.&lt;/p&gt;
&lt;p&gt;You can build web applications with Python through web frameworks such as &lt;a href=&quot;https://www.djangoproject.com/&quot;&gt;&lt;code&gt;django&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;https://flask.palletsprojects.com/en/stable/&quot;&gt;&lt;code&gt;flask&lt;/code&gt;&lt;/a&gt;. The list of frameworks for building web applications using Python is long. There are plenty to choose from, but &lt;code&gt;django&lt;/code&gt; and &lt;code&gt;flask&lt;/code&gt; remain the most popular web frameworks.&lt;/p&gt;
&lt;h3 id=&quot;desktop-gui&quot;&gt;Desktop GUI&lt;a class=&quot;headerlink&quot; href=&quot;#desktop-gui&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Every time you perform a task on your PC, be it a desktop or laptop, it is through an application. As an intermediate Python developer, you can make your own desktop applications.&lt;/p&gt;
&lt;p&gt;You do not have to learn any front-end technology to create your own &lt;a href=&quot;/ref/glossary/graphical-user-interface/&quot; class=&quot;ref-link&quot;&gt;Graphical User Interface (GUI)&lt;/a&gt; applications, as you saw with web applications. You can build all the parts using Python.&lt;/p&gt;
&lt;p&gt;There are frameworks for building your desktop applications. &lt;a href=&quot;https://realpython.com/pysimplegui-python/&quot;&gt;&lt;code&gt;PySimpleGUI&lt;/code&gt;&lt;/a&gt; is one of them, and it’s pretty user-friendly for an intermediate Python developer.&lt;/p&gt;
&lt;p&gt;An advanced GUI framework like &lt;a href=&quot;https://pypi.org/project/PyQt6/&quot;&gt;&lt;code&gt;PyQt6&lt;/code&gt;&lt;/a&gt; is quite powerful, but it may have a steep learning curve.&lt;/p&gt;
&lt;p&gt;The software you create for the Desktop GUI is able to work on any of the Windows, Linux, or Mac operating systems. All you have to do after creating the project is compile it to an executable for your operating system of choice.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/intermediate-python-project-ideas/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/intermediate-python-project-ideas/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Managing Python Projects With uv: An All-in-One Solution</title>
      <id>https://realpython.com/python-uv/</id>
      <link href="https://realpython.com/python-uv/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Learn how to create and manage your Python projects using uv, an extremely fast Python package and project manager written in Rust.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;The uv tool is a high-speed package and project manager for Python. It’s written in Rust and designed to streamline your workflow. It offers fast &lt;a href=&quot;/ref/glossary/dependency/&quot; class=&quot;ref-link&quot;&gt;dependency&lt;/a&gt; installation and integrates various functionalities into a single tool.&lt;/p&gt;
&lt;p&gt;With uv, you can install and manage multiple Python versions, create virtual environments, efficiently handle project dependencies, reproduce working environments, and even build and publish a project. These capabilities make uv an all-in-one tool for Python project management.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;uv is a Python package and project manager&lt;/strong&gt; that integrates multiple functionalities into one tool, offering a comprehensive solution for managing Python projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv is used for fast dependency installation&lt;/strong&gt;, &lt;a href=&quot;/ref/glossary/virtual-environment/&quot; class=&quot;ref-link&quot;&gt;virtual environment&lt;/a&gt; management, Python version management, and project initialization, enhancing productivity and efficiency.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv can build and publish Python packages&lt;/strong&gt; to package repositories like PyPI, supporting a streamlined process from development to distribution.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;uv automatically handles virtual environments&lt;/strong&gt;, creating and managing them as needed to ensure clean and isolated project dependencies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To dive deeper into managing your Python projects efficiently with uv, you should have a basic understanding of using Python virtual environments, setting up &lt;code&gt;pyproject.toml&lt;/code&gt; files for projects, and building distributable packages for a project.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Cheat Sheet:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-uv-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-python-uv-code&quot; markdown&gt;Click here to download the free uv vs pip cheat sheet&lt;/a&gt; that puts uv and pip side by side so you can choose the right tool for your projects.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Managing Python Projects With uv: An All-in-One Solution” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-uv/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #e5c6aa;&quot; alt=&quot;Managing Python Projects With uv: An All-in-One Solution&quot; src=&quot;https://files.realpython.com/media/Showcase-uv_Watermarked-2.4bbd6b119bc4.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Showcase-uv_Watermarked-2.4bbd6b119bc4.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Showcase-uv_Watermarked-2.4bbd6b119bc4.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Showcase-uv_Watermarked-2.4bbd6b119bc4.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Showcase-uv_Watermarked-2.4bbd6b119bc4.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-uv/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Managing Python Projects With uv: An All-in-One Solution&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of the uv tool, a high-speed package and project manager for Python.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;getting-to-know-uv-for-python&quot;&gt;Getting to Know uv for Python&lt;a class=&quot;headerlink&quot; href=&quot;#getting-to-know-uv-for-python&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Recently, a few exciting tools built with the &lt;a href=&quot;https://rust-lang.org/&quot;&gt;Rust&lt;/a&gt; programming language have appeared in the Python tooling ecosystem. &lt;a href=&quot;https://realpython.com/ruff-python/&quot;&gt;Ruff&lt;/a&gt;—a &lt;a href=&quot;/ref/glossary/linter/&quot; class=&quot;ref-link&quot;&gt;linter&lt;/a&gt; and code formatter for Python—is a well-known and popular example of one of these tools.&lt;/p&gt;
&lt;p&gt;In this tutorial, you’ll explore another cool tool made with Rust for Python. You’ll get to know &lt;a href=&quot;https://docs.astral.sh/uv/&quot;&gt;uv&lt;/a&gt;, an extremely fast Python &lt;strong&gt;package and project manager&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The main idea behind these tools is to accelerate your Python workflow by speeding up your project management actions. For example, Ruff is 10 to 100 times faster than linters like &lt;a href=&quot;https://flake8.pycqa.org/en/latest/&quot;&gt;Flake8&lt;/a&gt; and code formatters like &lt;a href=&quot;https://black.readthedocs.io/en/stable/&quot;&gt;Black&lt;/a&gt;. Similarly, for package installation, uv is &lt;a href=&quot;https://github.com/astral-sh/uv/blob/main/BENCHMARKS.md&quot;&gt;10 to 100 times faster&lt;/a&gt; than &lt;a href=&quot;https://realpython.com/what-is-pip/&quot;&gt;&lt;code&gt;pip&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Pick a few packages below and start the race to compare how long uv and &lt;code&gt;pip&lt;/code&gt; take to install them. The times are illustrative rather than a strict benchmark:&lt;/p&gt;
&lt;div&gt;
  &lt;widget-embed src=&quot;/widgets/uv-vs-pip-install-race/1784200883/&quot; slug=&quot;uv-vs-pip-install-race&quot; class=&quot;border rounded&quot; title=&quot;uv vs pip: Dependency Install Race&quot;&gt;
    &lt;div class=&quot;widget-embed__fallback&quot; data-widget-fallback&gt;
      Interactive diagram — enable JavaScript to view.
    &lt;/div&gt;
  &lt;/widget-embed&gt;
&lt;/div&gt;

&lt;p&gt;Additionally, uv integrates into one tool most of the functionality provided by tools like &lt;code&gt;pip&lt;/code&gt;, &lt;code&gt;pip-tools&lt;/code&gt;, &lt;a href=&quot;https://realpython.com/python-pipx/&quot;&gt;&lt;code&gt;pipx&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/dependency-management-python-poetry/&quot;&gt;&lt;code&gt;poetry&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/intro-to-pyenv/&quot;&gt;&lt;code&gt;pyenv&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://twine.readthedocs.io/en/stable/&quot;&gt;&lt;code&gt;twine&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/#the-virtualenv-project&quot;&gt;&lt;code&gt;virtualenv&lt;/code&gt;&lt;/a&gt;, and more. Therefore, uv is an all-in-one solution.&lt;/p&gt;
&lt;p&gt;Here’s a quick list of key uv features for managing your Python projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Fast dependency installation&lt;/strong&gt;: Installs dependencies really fast, which is especially useful for large dependency trees.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Virtual environment management&lt;/strong&gt;: Automatically creates and manages &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environments&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Python version management&lt;/strong&gt;: Allows the installation and management of multiple Python versions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Project initialization&lt;/strong&gt;: Scaffolds a full Python project, including the root directory, &lt;a href=&quot;https://realpython.com/python-git-github-intro/&quot;&gt;Git&lt;/a&gt; repository, virtual environment, &lt;a href=&quot;https://realpython.com/python-pyproject-toml/&quot;&gt;&lt;code&gt;pyproject.toml&lt;/code&gt;&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/readme-python-project/&quot;&gt;&lt;code&gt;README&lt;/code&gt;&lt;/a&gt;, and more.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dependency management&lt;/strong&gt;: Installs, updates, removes, and locks direct and &lt;a href=&quot;https://en.wikipedia.org/wiki/Transitive_dependency&quot;&gt;transitive dependencies&lt;/a&gt;, which allows for environment reproducibility.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Package builds and publication management&lt;/strong&gt;: Allows you to build and publish packages to package repositories like the &lt;a href=&quot;/ref/glossary/pypi/&quot; class=&quot;ref-link&quot;&gt;Python Package Index (PyPI)&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Developer tooling support&lt;/strong&gt;: Installs and lets you run development tools, such as &lt;code&gt;pytest&lt;/code&gt;, &lt;a href=&quot;/ref/tools/black/&quot; class=&quot;ref-link&quot;&gt;Black&lt;/a&gt;, and Ruff.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Apart from these features, uv is a standalone binary that allows for a smooth installation and quick upgrades. You don’t need to have Python installed on your system to install uv.&lt;/p&gt;
&lt;p&gt;So, with this quick summary of uv and its main features, you’re ready to install this tool on your system. That’s what you’ll do in the following section. Additionally, you’ll learn how to update your uv installation.&lt;/p&gt;
&lt;h2 id=&quot;installing-uv-to-manage-python-projects&quot;&gt;Installing uv to Manage Python Projects&lt;a class=&quot;headerlink&quot; href=&quot;#installing-uv-to-manage-python-projects&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first step in using any tool is to install it on your operating system. To install uv, you have several options. The quickest one would be to use the standalone installer. Another friendly option is to install uv from &lt;a href=&quot;https://pypi.org&quot;&gt;PyPI&lt;/a&gt; using other tools like &lt;code&gt;pipx&lt;/code&gt; or &lt;a href=&quot;/ref/glossary/pip/&quot; class=&quot;ref-link&quot;&gt;pip&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the official &lt;a href=&quot;https://docs.astral.sh/uv/getting-started/installation/&quot;&gt;uv installation guide&lt;/a&gt;, you’ll find several other installation options. For example, you can use tools like &lt;a href=&quot;https://brew.sh/&quot;&gt;Homebrew&lt;/a&gt; and &lt;a href=&quot;https://doc.rust-lang.org/cargo/&quot;&gt;Cargo&lt;/a&gt;, depending on your current platform and operating system. However, in this tutorial, you’ll only explore the standalone installer and the PyPI options.&lt;/p&gt;
&lt;h3 id=&quot;using-the-standalone-installer&quot;&gt;Using the Standalone Installer&lt;a class=&quot;headerlink&quot; href=&quot;#using-the-standalone-installer&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The uv project provides a standalone installer that you can use to download and install the tool in your system. Below are the relevant commands for the three main operating systems:&lt;/p&gt;
&lt;ul class=&quot;nav nav-tabs justify-content-end js-platform-widget-tabs&quot; role=&quot;tablist&quot;&gt;

  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-windows&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body active small&quot; id=&quot;windows-tab-1&quot; data-bs-toggle=&quot;tab&quot; href=&quot;#windows-1&quot; role=&quot;tab&quot; aria-controls=&quot;windows-1&quot; aria-selected=&quot;true&quot;&gt;&lt;span class=&quot;icon baseline text-muted me-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#brands--windows&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Windows&lt;/a&gt;
  &lt;/li&gt;




  &lt;li class=&quot;nav-item mb-0 js-platform-widget-tab-linuxmacos&quot; role=&quot;presentation&quot;&gt;
    &lt;a class=&quot;nav-link link-unstyled text-body small&quot; id=&quot;macos-tab-1&quot; data-bs-toggle=&quot;tab&quot; href=&quot;#linux-macos-1&quot; role=&quot;tab&quot; aria-controls=&quot;linux-macos-1&quot; aria-selected=&quot;false&quot;&gt;&lt;span class=&quot;icon baseline text-muted&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#v4--linux&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span class=&quot;icon baseline text-muted me-1&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#v4--apple&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;Linux + macOS&lt;/a&gt;
  &lt;/li&gt;

&lt;/ul&gt;
&lt;div class=&quot;tab-content mt-2 mb-0 js-platform-widget-content&quot;&gt;
&lt;div aria-labelledby=&quot;windows-tab-1&quot; class=&quot;tab-pane fade show active&quot; id=&quot;windows-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pscon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Windows PowerShell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;PS&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;powershell&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-ExecutionPolicy&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ByPass&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;irm https://astral.sh/uv/install.ps1 | iex&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;div aria-labelledby=&quot;linux-macos-tab-1&quot; class=&quot;tab-pane fade &quot; id=&quot;linux-macos-1&quot; role=&quot;tabpanel&quot;&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;curl&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-LsSf&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;https://astral.sh/uv/install.sh&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;If you don’t have &lt;code&gt;curl&lt;/code&gt; installed on your system, then you can use &lt;code&gt;wget&lt;/code&gt; as shown below:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;wget&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-qO-&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;https://astral.sh/uv/install.sh&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-uv/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-uv/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>A Practical Introduction to Web Scraping in Python</title>
      <id>https://realpython.com/python-web-scraping-practical-introduction/</id>
      <link href="https://realpython.com/python-web-scraping-practical-introduction/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Get started with Python web scraping: parse data from websites and interact with HTML forms using Beautiful Soup and MechanicalSoup.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;Python web scraping allows you to collect and parse data from websites programmatically. With powerful libraries like &lt;code&gt;urllib&lt;/code&gt;, Beautiful Soup, and MechanicalSoup, you can fetch and manipulate HTML content effortlessly. By automating data collection tasks, Python makes web scraping both efficient and effective.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Python is &lt;strong&gt;well-suited for web scraping&lt;/strong&gt; due to its &lt;strong&gt;extensive libraries&lt;/strong&gt;, such as Beautiful Soup and MechanicalSoup.&lt;/li&gt;
&lt;li&gt;You can scrape websites with Python by &lt;strong&gt;fetching HTML content&lt;/strong&gt; using &lt;code&gt;urllib&lt;/code&gt; and &lt;strong&gt;extracting data&lt;/strong&gt; using string &lt;a href=&quot;/ref/glossary/method/&quot; class=&quot;ref-link&quot;&gt;methods&lt;/a&gt; or parsers like Beautiful Soup.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Beautiful Soup&lt;/strong&gt; is a great choice for &lt;strong&gt;parsing HTML&lt;/strong&gt; documents with Python effectively.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data scraping may be illegal&lt;/strong&gt; if it violates a website’s terms of use, so always review the website’s acceptable use policy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial guides you through extracting data from websites using string methods, regular expressions, and HTML parsers.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This tutorial is adapted from the chapter “Interacting With the Web” in &lt;a href=&quot;https://realpython.com/products/python-basics-book/&quot;&gt;&lt;em&gt;Python Basics: A Practical Introduction to Python 3&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The book uses Python’s built-in &lt;a href=&quot;https://realpython.com/python-idle/&quot;&gt;IDLE&lt;/a&gt; editor to create and edit Python files and interact with the Python shell, so you’ll see occasional references to IDLE throughout this tutorial. However, you should have no problems running the example code from the &lt;a href=&quot;https://realpython.com/python-ides-code-editors-guide/&quot;&gt;editor&lt;/a&gt; and &lt;a href=&quot;https://realpython.com/effective-python-environment/&quot;&gt;environment&lt;/a&gt; of your choice.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Source Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/python-web-scraping-practical-introduction-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-python-web-scraping-practical-introduction-code&quot; markdown&gt;Click here to get the working web scraping scripts&lt;/a&gt; from this tutorial so you can start collecting and parsing data from the Web right away.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “A Practical Introduction to Web Scraping in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/python-web-scraping-practical-introduction/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #abe5b2;&quot; alt=&quot;Web Scraping in Python&quot; src=&quot;https://files.realpython.com/media/Python-Basics-Chapter-on-Web-Scraping_Watermarked.f8d56f56c22c.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Python-Basics-Chapter-on-Web-Scraping_Watermarked.f8d56f56c22c.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Python-Basics-Chapter-on-Web-Scraping_Watermarked.f8d56f56c22c.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Python-Basics-Chapter-on-Web-Scraping_Watermarked.f8d56f56c22c.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Python-Basics-Chapter-on-Web-Scraping_Watermarked.f8d56f56c22c.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/python-web-scraping-practical-introduction/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;A Practical Introduction to Web Scraping in Python&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;In this quiz, you&#x27;ll test your understanding of web scraping in Python. Web scraping is a powerful tool for data collection and analysis. By working through this quiz, you&#x27;ll revisit how to parse website data using string methods, regular expressions, and HTML parsers, as well as how to interact with forms and other website components.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;scrape-and-parse-text-from-websites&quot;&gt;Scrape and Parse Text From Websites&lt;a class=&quot;headerlink&quot; href=&quot;#scrape-and-parse-text-from-websites&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Collecting data from websites using an automated process is known as web scraping. Some websites explicitly forbid users from scraping their data with automated tools like the ones that you’ll create in this tutorial. Websites do this for two possible reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The site has a good reason to protect its data. For instance, Google Maps doesn’t let you request too many results too quickly.&lt;/li&gt;
&lt;li&gt;Making many repeated requests to a website’s server may use up bandwidth, slowing down the website for other users and potentially overloading the server such that the website stops responding entirely.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Before using your Python skills for web scraping, you should always check your target website’s acceptable use policy to see if accessing the website with automated tools is a violation of its terms of use. Legally, web scraping against the wishes of a website is very much a gray area.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Please be aware that the following techniques &lt;a href=&quot;https://en.wikipedia.org/wiki/Web_scraping#Legal_issues&quot;&gt;may be illegal&lt;/a&gt; when used on websites that prohibit web scraping.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;For this tutorial, you’ll use a page that’s hosted on Real Python’s server. The page that you’ll access has been set up for use with this tutorial.&lt;/p&gt;
&lt;p&gt;Now that you’ve read the disclaimer, you can get to the fun stuff. In the next section, you’ll start grabbing all the HTML code from a single web page.&lt;/p&gt;
&lt;h3 id=&quot;build-your-first-web-scraper&quot;&gt;Build Your First Web Scraper&lt;a class=&quot;headerlink&quot; href=&quot;#build-your-first-web-scraper&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;One useful &lt;a href=&quot;/ref/glossary/package/&quot; class=&quot;ref-link&quot;&gt;package&lt;/a&gt; for web scraping that you can find in Python’s &lt;a href=&quot;https://docs.python.org/3/library/&quot;&gt;standard library&lt;/a&gt; is &lt;code&gt;urllib&lt;/code&gt;, which contains tools for working with URLs. In particular, the &lt;a href=&quot;https://realpython.com/urllib-request/&quot;&gt;&lt;code&gt;urllib.request&lt;/code&gt;&lt;/a&gt; &lt;a href=&quot;/ref/glossary/module/&quot; class=&quot;ref-link&quot;&gt;module&lt;/a&gt; contains a function called &lt;code&gt;urlopen()&lt;/code&gt; that you can use to open a URL within a program.&lt;/p&gt;
&lt;p&gt;In IDLE’s interactive window, type the following to import &lt;code&gt;urlopen()&lt;/code&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;urllib.request&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;urlopen&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;The web page that you’ll open is at the following URL:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;http://olympus.realpython.org/profiles/aphrodite&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;To open the web page, pass &lt;code&gt;url&lt;/code&gt; to &lt;code&gt;urlopen()&lt;/code&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;urlopen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;&lt;code&gt;urlopen()&lt;/code&gt; returns an &lt;code&gt;HTTPResponse&lt;/code&gt; &lt;a href=&quot;/ref/glossary/object/&quot; class=&quot;ref-link&quot;&gt;object&lt;/a&gt;:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;page&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;&amp;lt;http.client.HTTPResponse object at 0x105fef820&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;To extract the HTML from the page, first use the &lt;code&gt;HTTPResponse&lt;/code&gt; object’s &lt;code&gt;.read()&lt;/code&gt; method, which returns a sequence of bytes. Then use &lt;code&gt;.decode()&lt;/code&gt; to &lt;a href=&quot;https://realpython.com/convert-python-bytes-to-strings/&quot;&gt;decode the bytes to a string&lt;/a&gt; using &lt;a href=&quot;https://realpython.com/python-encodings-guide/#unicode-vs-utf-8&quot;&gt;UTF-8&lt;/a&gt;:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/python-web-scraping-practical-introduction/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/python-web-scraping-practical-introduction/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>ChromaDB: Embeddings and Vector Databases in Python</title>
      <id>https://realpython.com/chromadb-vector-database/</id>
      <link href="https://realpython.com/chromadb-vector-database/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Learn what embeddings and vector databases are, then store, query, and filter text with ChromaDB in Python and use it to give an LLM context.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;&lt;a href=&quot;https://docs.trychroma.com/&quot;&gt;ChromaDB&lt;/a&gt; is an open-source vector database built for applications that use &lt;a href=&quot;https://en.wikipedia.org/wiki/Large_language_model&quot;&gt;large language models&lt;/a&gt; (LLMs). LLMs like the ones behind OpenAI’s &lt;a href=&quot;https://realpython.com/chatgpt-coding-mentor-python/&quot;&gt;ChatGPT&lt;/a&gt; can reason about &lt;a href=&quot;https://en.wikipedia.org/wiki/Natural_language_processing&quot;&gt;natural language processing (NLP)&lt;/a&gt; problems remarkably well, but on their own, they only know what appeared in their training data.&lt;/p&gt;
&lt;p&gt;They can also only read a limited number of text &lt;a href=&quot;/ref/ai-coding-glossary/token/&quot; class=&quot;ref-link&quot;&gt;tokens&lt;/a&gt; at once. If you asked ChatGPT to summarize confidential company documents, then you’d have to decide which documents to show it first.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;&lt;a href=&quot;/ref/ai-coding-glossary/vector-database/&quot; class=&quot;ref-link&quot;&gt;vector database&lt;/a&gt;&lt;/strong&gt; allows you to store encoded unstructured objects, like text, as lists of numbers that you can compare to one another. You can, for example, find the collection of documents relevant to a question that you want an LLM to answer. In this tutorial, you’ll learn the concepts behind embeddings and vector databases, and then you’ll put them to work with ChromaDB in Python.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this tutorial, you’ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Vectors&lt;/strong&gt; represent unstructured objects as arrays of numbers, and &lt;strong&gt;cosine similarity&lt;/strong&gt; measures how closely two vectors point in the same direction.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Embeddings&lt;/strong&gt; are dense vectors that capture the meaning of words and text, and you can create them in Python with spaCy and SentenceTransformers.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;vector database&lt;/strong&gt; stores embeddings and returns the entries most similar to a query instead of exact matches.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ChromaDB&lt;/strong&gt; lets you create collections, add documents with metadata, and run semantic queries with metadata filters in a few lines of Python.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Retrieval-augmented generation (RAG)&lt;/strong&gt; uses a vector database like ChromaDB to find relevant documents and pass them to an LLM as context.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After reading, you’ll have the foundational knowledge to use ChromaDB in your NLP or LLM applications. Before reading, you should be comfortable with the &lt;a href=&quot;https://realpython.com/learning-paths/python-basics/&quot;&gt;basics of Python&lt;/a&gt; and high school math. This tutorial was written for ChromaDB 1.5 and Python 3.12 or later, and every install command pins the package versions that the code was tested with.&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Get Your Code:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/embeddings-and-vector-databases-with-chromadb-code/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-embeddings-and-vector-databases-with-chromadb-code&quot; markdown&gt;Click here to download the car review search project&lt;/a&gt; that shows you how to use ChromaDB to add context to an LLM.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;container border rounded text-wrap-pretty my-3&quot;&gt;

  &lt;p class=&quot;my-3&quot;&gt;&lt;mark class=&quot;marker-highlight&quot;&gt;&lt;strong&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt; Take the Quiz:&lt;/strong&gt;&lt;/mark&gt; Test your knowledge with our interactive “Embeddings and Vector Databases With ChromaDB” quiz. You’ll receive a score upon completion to help you track your learning progress:&lt;/p&gt;

  &lt;hr&gt;

  &lt;div class=&quot;row my-3&quot;&gt;
    &lt;div class=&quot;col-12 col-sm-4 col-md-3 align-self-center&quot;&gt;

      &lt;a href=&quot;/quizzes/chromadb-vector-database/&quot; tabindex=&quot;-1&quot;&gt;
        &lt;div class=&quot;ratio ratio-16x9&quot;&gt;

            &lt;img class=&quot;card-img-top m-0 p-0 rounded&quot; style=&quot;object-fit: contain; background: #aae4b1;&quot; alt=&quot;Embeddings and Vector Databases With ChromaDB&quot; src=&quot;https://files.realpython.com/media/Embeddings-and-Vector-Databases-with-ChromaDB_Watermarked.646a2e85613a.jpg&quot; width=&quot;1920&quot; height=&quot;1080&quot; srcset=&quot;/cdn-cgi/image/width=480,format=auto/https://files.realpython.com/media/Embeddings-and-Vector-Databases-with-ChromaDB_Watermarked.646a2e85613a.jpg 480w, /cdn-cgi/image/width=640,format=auto/https://files.realpython.com/media/Embeddings-and-Vector-Databases-with-ChromaDB_Watermarked.646a2e85613a.jpg 640w, /cdn-cgi/image/width=960,format=auto/https://files.realpython.com/media/Embeddings-and-Vector-Databases-with-ChromaDB_Watermarked.646a2e85613a.jpg 960w, /cdn-cgi/image/width=1920,format=auto/https://files.realpython.com/media/Embeddings-and-Vector-Databases-with-ChromaDB_Watermarked.646a2e85613a.jpg 1920w&quot; sizes=&quot;(min-width: 1200px) 142px, (min-width: 1000px) 122px, (min-width: 780px) 112px, (min-width: 580px) 139px, calc(100vw - 62px)&quot;&gt;


          &lt;div class=&quot;card-img-overlay d-flex align-items-center&quot;&gt;
            &lt;div class=&quot;mx-auto&quot;&gt;
              &lt;span class=&quot;text-light&quot; style=&quot;opacity: 0.90;&quot;&gt;&lt;span class=&quot;icon baseline scale2x&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@quiz&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/a&gt;

    &lt;/div&gt;

    &lt;div class=&quot;col position-relative&quot;&gt;
      &lt;div class=&quot;mt-3 d-md-none&quot;&gt;&lt;/div&gt; 
      &lt;p class=&quot;small text-muted mb-0&quot;&gt;&lt;strong&gt;Interactive Quiz&lt;/strong&gt;&lt;/p&gt;
      &lt;a href=&quot;/quizzes/chromadb-vector-database/&quot; class=&quot;stretched-link&quot;&gt;&lt;span class=&quot;my-0 h4&quot;&gt;Embeddings and Vector Databases With ChromaDB&lt;/span&gt;&lt;/a&gt; 
      &lt;p class=&quot;text-muted mb-0 small&quot;&gt;Check your grasp of ChromaDB, embeddings, and vector search. Practice cosine similarity, querying collections, and using RAG with LLMs in Python.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;

&lt;/div&gt;

&lt;h2 id=&quot;represent-data-as-vectors&quot;&gt;Represent Data as Vectors&lt;a class=&quot;headerlink&quot; href=&quot;#represent-data-as-vectors&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before diving into embeddings and vector databases, you should understand what vectors are and what they represent. Feel free to skip ahead to the next section if you’re already comfortable with vector concepts. If you’re not or if you could use a refresher, then keep reading!&lt;/p&gt;
&lt;h3 id=&quot;vector-basics&quot;&gt;Vector Basics&lt;a class=&quot;headerlink&quot; href=&quot;#vector-basics&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can describe vectors with variable levels of complexity, but one great starting place is to think of a &lt;a href=&quot;/ref/ai-coding-glossary/vector/&quot; class=&quot;ref-link&quot;&gt;vector&lt;/a&gt; as an &lt;a href=&quot;https://realpython.com/numpy-array-programming/#getting-into-shape-intro-to-numpy-arrays&quot;&gt;array&lt;/a&gt; of numbers. For example, you could represent vectors using &lt;a href=&quot;https://realpython.com/numpy-tutorial/&quot;&gt;NumPy&lt;/a&gt; arrays. To follow along, create a &lt;a href=&quot;https://realpython.com/python-virtual-environments-a-primer/&quot;&gt;virtual environment&lt;/a&gt;, activate it, and install NumPy:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;console&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--yellow&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Shell&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp gp-VirtualEnv&quot;&gt;(.venv)&lt;/span&gt; &lt;span class=&quot;gp&quot;&gt;$ &lt;/span&gt;python&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;-m&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;pip&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;install&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;numpy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;.5.3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;With NumPy installed, you can create your first vectors:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;numpy&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;np&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vector1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vector2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vector1&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;array([1, 0])&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vector2&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;array([0, 1])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;In this code block, you import &lt;code&gt;numpy&lt;/code&gt; and create two arrays, &lt;code&gt;vector1&lt;/code&gt; and &lt;code&gt;vector2&lt;/code&gt;, representing vectors. This is one of the most common and useful ways to work with vectors in Python, and &lt;code&gt;NumPy&lt;/code&gt; offers a variety of functionality to manipulate vectors. There are also several other libraries that you can use to work with vector data, such as &lt;a href=&quot;https://realpython.com/pytorch-vs-tensorflow/&quot;&gt;PyTorch&lt;/a&gt;, &lt;a href=&quot;https://realpython.com/pytorch-vs-tensorflow/&quot;&gt;TensorFlow&lt;/a&gt;, &lt;a href=&quot;https://jax.readthedocs.io/en/latest/notebooks/quickstart.html&quot;&gt;JAX&lt;/a&gt;, and &lt;a href=&quot;https://realpython.com/polars-python/&quot;&gt;Polars&lt;/a&gt;. You’ll stick with NumPy for this overview.   &lt;/p&gt;
&lt;p&gt;You’ve created two NumPy arrays that represent vectors. Now what? It turns out you can do a lot of cool things with vectors, but before continuing on, you’ll need to understand some key definitions and properties:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dimension&lt;/strong&gt;: The dimension of a vector is the number of elements that it contains. In the example above, &lt;code&gt;vector1&lt;/code&gt; and &lt;code&gt;vector2&lt;/code&gt; are both two-dimensional since they each have two elements. You can only visualize vectors with three dimensions or less, but generally, vectors can have any number of dimensions. In fact, as you’ll see later, vectors that encode words and text tend to have hundreds or thousands of dimensions. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Magnitude&lt;/strong&gt;: The magnitude of a vector is a non-negative number that represents the vector’s size or length. You can also refer to the magnitude of a vector as the &lt;strong&gt;norm&lt;/strong&gt;, and you can denote it with &lt;em&gt;||v||&lt;/em&gt; or &lt;em&gt;|v|&lt;/em&gt;. There are many different definitions of magnitude or norm, but the most common is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Norm_(mathematics)#Euclidean_norm&quot;&gt;Euclidean norm&lt;/a&gt; or 2-norm. You’ll learn how to compute this later.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Unit vector&lt;/strong&gt;: A unit vector is a vector with a magnitude of one. In the example above, &lt;code&gt;vector1&lt;/code&gt; and &lt;code&gt;vector2&lt;/code&gt; are unit vectors.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Direction&lt;/strong&gt;: The direction of a vector specifies the line along which the vector points. You can represent direction using angles, unit vectors, or coordinates in different coordinate systems. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dot product (scalar product)&lt;/strong&gt;: The dot product of two vectors, &lt;em&gt;u&lt;/em&gt; and &lt;em&gt;v&lt;/em&gt;, is a number given by &lt;em&gt;u ⋅ v = ||u|| ||v|| cos(θ)&lt;/em&gt;, where &lt;em&gt;θ&lt;/em&gt; is the angle between the two vectors. Another way to compute the dot product is to do an element-wise multiplication of &lt;em&gt;u&lt;/em&gt; and &lt;em&gt;v&lt;/em&gt; and sum the results. The dot product is one of the most important and widely used vector operations because it measures the &lt;strong&gt;similarity&lt;/strong&gt; between two vectors. You’ll see more of this later on.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Orthogonal vectors&lt;/strong&gt;: Vectors are orthogonal if their dot product is zero, meaning that they’re at a 90 degree angle to each other. You can think of orthogonal vectors as being completely unrelated to each other. &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dense vector&lt;/strong&gt;: A vector is considered dense if most of its elements are non-zero. Later on, you’ll see that words and text are most usefully represented with dense vectors because each dimension encodes meaningful information. &lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While there are many more definitions and properties to learn, these seven are most important for this tutorial. To solidify these ideas with code, check out the following block. Note that for the rest of this tutorial, you’ll use &lt;code&gt;v1&lt;/code&gt;, &lt;code&gt;v2&lt;/code&gt;, and &lt;code&gt;v3&lt;/code&gt; to name your vectors:&lt;/p&gt;
&lt;code-block class=&quot;mb-3&quot; data-syntax-language=&quot;pycon&quot; data-is-repl=&quot;true&quot;&gt;
  &lt;div class=&quot;codeblock__header codeblock--blue&quot;&gt;
    &lt;span class=&quot;me-2 noselect&quot;&gt;&lt;span class=&quot;visually-hidden&quot;&gt;Language: &lt;/span&gt;Python&lt;/span&gt;
    
    &lt;div class=&quot;noselect&quot;&gt;
      
        &lt;span class=&quot;codeblock__output-toggle&quot; title=&quot;Toggle prompts and output&quot; aria-label=&quot;Toggle prompts and output&quot; role=&quot;button&quot; tabindex=&quot;0&quot;&gt;&lt;span class=&quot;icon baseline js-codeblock-output-on codeblock__header--icon-lower&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#regular--rectangle-terminal&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/span&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;codeblock__contents&quot;&gt;
    &lt;div class=&quot;highlight highlight--with-header&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;numpy&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;as&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nn&quot;&gt;np&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)])&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Dimension&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shape&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;(2,)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Magnitude&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;np.float64(1.0)&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;linalg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;norm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;np.float64(1.0)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;linalg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;norm&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;np.float64(2.0)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# Dot product&lt;/span&gt;
&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;np&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;np.int64(0)&lt;/span&gt;

&lt;span class=&quot;gp&quot;&gt;&amp;gt;&amp;gt;&amp;gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;v1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;v3&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;np.float64(1.4142135623730951)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
    
    &lt;button class=&quot;codeblock__copy btn btn-outline-secondary border m-1 px-1 d-hover-only&quot; title=&quot;Copy to clipboard&quot; aria-label=&quot;Copy to clipboard&quot;&gt;&lt;span class=&quot;icon baseline&quot; aria-hidden=&quot;true&quot;&gt;&lt;svg aria-hidden=&quot;true&quot;&gt;&lt;use href=&quot;/static/icons.8f1dcd28e216.svg#@copy&quot;&gt;&lt;/use&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;
    
  &lt;/div&gt;
&lt;/code-block&gt;
&lt;p&gt;You first import &lt;code&gt;numpy&lt;/code&gt; and create the arrays &lt;code&gt;v1&lt;/code&gt;, &lt;code&gt;v2&lt;/code&gt;, and &lt;code&gt;v3&lt;/code&gt;. Checking &lt;code&gt;v1.shape&lt;/code&gt; shows you that &lt;code&gt;v1&lt;/code&gt; has two elements, which is its &lt;strong&gt;dimension&lt;/strong&gt; as a vector.&lt;/p&gt;
&lt;p&gt;You then see two different ways to compute the &lt;strong&gt;magnitude&lt;/strong&gt; of a NumPy array. The first, &lt;code&gt;np.sqrt(np.sum(v1**2))&lt;/code&gt;, uses the &lt;strong&gt;Euclidean norm&lt;/strong&gt; that you learned about above. The second computation uses &lt;code&gt;np.linalg.norm()&lt;/code&gt;, a NumPy function that computes the Euclidean norm of an array by default but can also compute &lt;a href=&quot;https://numpy.org/doc/stable/reference/generated/numpy.linalg.norm.html&quot;&gt;other matrix and vector norms&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Keep in mind that NumPy 2 displays scalar results wrapped in their type, such as &lt;code&gt;np.float64(2.0)&lt;/code&gt;. You can treat them like ordinary Python numbers.&lt;/p&gt;
&lt;p&gt;Lastly, you see two ways to calculate the &lt;strong&gt;dot product&lt;/strong&gt; between two vectors. Using &lt;code&gt;np.sum(v1 * v2)&lt;/code&gt; first computes the element-wise multiplication between &lt;code&gt;v1&lt;/code&gt; and &lt;code&gt;v2&lt;/code&gt; in a &lt;a href=&quot;https://realpython.com/numpy-array-programming/#what-is-vectorization&quot;&gt;vectorized&lt;/a&gt; fashion, and you sum the results to produce a single number. A better way to compute the dot product is to use the at-operator (&lt;code&gt;@&lt;/code&gt;), as you see with &lt;code&gt;v1 @ v3&lt;/code&gt;. This is because &lt;code&gt;@&lt;/code&gt; can perform both vector and matrix multiplications, and the syntax is cleaner.&lt;/p&gt;
&lt;p&gt;While all of these vector definitions and properties may seem straightforward to compute, you might still be wondering what they actually mean and why they’re important to understand. One way to better understand vectors is to visualize them in two dimensions. In this context, you can represent vectors as arrows, like in the following plot:&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/chromadb-vector-database/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/chromadb-vector-database/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Create a Flask Application With Google Login</title>
      <id>https://realpython.com/flask-google-login/</id>
      <link href="https://realpython.com/flask-google-login/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Build a Python Flask app with Google login so users can sign in with their Google account, and learn OAuth 2, OpenID Connect, and Flask-Login.</summary>
      <content type="html">
        &lt;div&gt;&lt;p&gt;You’ve probably seen the option for &lt;em&gt;Google Login&lt;/em&gt; on various websites. Some sites also have more options like &lt;em&gt;Facebook Login&lt;/em&gt; or &lt;em&gt;GitHub Login&lt;/em&gt;. All these options allow users to utilize existing accounts to use a new service.&lt;/p&gt;
&lt;p&gt;In this article, you’ll work through the creation of a &lt;a href=&quot;https://realpython.com/tutorials/flask/&quot;&gt;Flask&lt;/a&gt; web application. Your application will allow a user to log in using their Google identity instead of creating a new account. There are tons of benefits with this method of user management. It’s going to be safer and simpler than managing the traditional username and password combinations.&lt;/p&gt;
&lt;p&gt;This article will be more straightforward if you already understand the &lt;a href=&quot;https://realpython.com/learning-paths/python3-introduction/&quot;&gt;basics of Python&lt;/a&gt;. It would also help to know a bit about web frameworks and HTTP requests, but that’s not strictly necessary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this article, you’ll be able to:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create a Flask web application that lets users log in with Google&lt;/li&gt;
&lt;li&gt;Create client credentials to interact with Google&lt;/li&gt;
&lt;li&gt;Use Flask-Login for user session management in a Flask application&lt;/li&gt;
&lt;li&gt;Better understand OAuth 2 and OpenID Connect (OIDC)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can click the box below to get the code for the application you’ll make in this article:&lt;/p&gt;
&lt;div class=&quot;alert alert-warning&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong markdown&gt;Download Sample Project:&lt;/strong&gt; &lt;a href=&quot;https://realpython.com/bonus/google-login-project/&quot; class=&quot;alert-link&quot; data-bs-toggle=&quot;modal&quot; data-bs-target=&quot;#modal-google-login-project&quot; markdown&gt;Get the complete Flask app with Google login&lt;/a&gt; that you build in this tutorial, ready to run with your own credentials.&lt;/p&gt;
&lt;/div&gt;
&lt;h2 id=&quot;why-use-google-login-for-your-users&quot;&gt;Why Use Google Login for Your Users?&lt;a class=&quot;headerlink&quot; href=&quot;#why-use-google-login-for-your-users&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;You may want individual users to have profiles. Or perhaps you want to provide features to only certain users. In any case, you’ll need to know who’s interacting with your application. In other words, you’ll need to authenticate users and identify them in some unique way.&lt;/p&gt;
&lt;p&gt;The traditional solution is to use a unique username and a secret password. Your application would store that information and ask for it when needed. However, there are a few downsides to that solution:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have to securely manage the passwords.&lt;/li&gt;
&lt;li&gt;You have to implement any account-related functionality:&lt;ul&gt;
&lt;li&gt;Two-factor authentication&lt;/li&gt;
&lt;li&gt;Password reset&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;You have to protect against malicious login attempts.&lt;/li&gt;
&lt;li&gt;Your users have to remember yet another username and password.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By using Google login for your users, you push all that responsibility to them. Your application waits for the user to go through authentication. Google then tells your application about that user. At that point, you can effectively log them into your application.&lt;/p&gt;
&lt;p&gt;You don’t have to store any passwords, and Google handles all the security.&lt;/p&gt;
&lt;h2 id=&quot;how-applications-use-google-login&quot;&gt;How Applications Use Google Login&lt;a class=&quot;headerlink&quot; href=&quot;#how-applications-use-google-login&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are two very popular and important specifications called &lt;a href=&quot;https://datatracker.ietf.org/doc/html/rfc6749&quot;&gt;OAuth 2&lt;/a&gt; and &lt;a href=&quot;https://openid.net/specs/openid-connect-core-1_0.html&quot;&gt;OpenID Connect (OIDC)&lt;/a&gt;. OIDC is built on top of OAuth 2, adding a few new ideas and concepts.&lt;/p&gt;
&lt;p&gt;These specifications define how a third-party application can obtain information from another service. This usually involves obtaining consent from a user. To unpack this a bit, let’s look at how this applies to the application you’re about to build.&lt;/p&gt;
&lt;p&gt;You’re about to write a third-party application, and it will let a user use a &lt;em&gt;Google Login&lt;/em&gt; button to log in. To do that, Google needs to know about your application. Luckily, you can register your application as a client to Google.&lt;/p&gt;
&lt;p&gt;Once a user comes to your application and presses the &lt;em&gt;Google Login&lt;/em&gt; button, you can send them to Google. From there, Google needs to make sure that the user consents to pass along their email and other information to your application. Should the user consent, Google sends back some information to your application. You then store that information and can reference it later, effectively logging the user in.&lt;/p&gt;
&lt;h2 id=&quot;openid-connect-details&quot;&gt;OpenID Connect Details&lt;a class=&quot;headerlink&quot; href=&quot;#openid-connect-details&quot; title=&quot;Permanent link&quot;&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To request information on behalf of a user, you must become a &lt;code&gt;client&lt;/code&gt; to the authentication server, also known as the provider. The first thing you’ll realize if you dig into these specifications is that there are a lot of overlapping terms and concepts.&lt;/p&gt;
&lt;p&gt;So as a third-party application (also known as a client), you want to get info from the provider on the user’s behalf. There are a series of steps that enable that to happen, and those steps must happen in a specific order. That’s why you’ll sometimes hear OAuth 2 and OpenID Connect referred to as a &lt;strong&gt;handshake&lt;/strong&gt;, &lt;strong&gt;flow&lt;/strong&gt;, or &lt;strong&gt;dance&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Those steps are, broadly:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You register a third-party application as a client to the provider:&lt;ul&gt;
&lt;li&gt;You receive unique client credentials from the provider.&lt;/li&gt;
&lt;li&gt;You’ll use these client credentials to authenticate (prove who you are) to the provider later on.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The client sends a request to the provider’s &lt;code&gt;authorization&lt;/code&gt; URL&lt;/li&gt;
&lt;li&gt;The provider asks the user to authenticate (prove who they are)&lt;/li&gt;
&lt;li&gt;The provider asks the user to consent to the client acting on their behalf:&lt;ul&gt;
&lt;li&gt;Usually this includes limited access, and it’s made clear to the user what the client is asking for.&lt;/li&gt;
&lt;li&gt;This is like when you have to approve an app on your phone to have access to location or contacts.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;The provider sends the client a unique authorization code.&lt;/li&gt;
&lt;li&gt;The client sends the authorization code back to the Provider’s &lt;code&gt;token&lt;/code&gt; URL.&lt;/li&gt;
&lt;li&gt;The provider sends the client tokens to use with other provider URLs on behalf of the user.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The steps above are for the Authorization Code Flow, as defined by OAuth 2.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Those steps include both of the standards mentioned so far. OpenID Connect (OIDC) is built on top of OAuth 2, adding a few additional features and requirements, mostly involving the process of authentication. Other than the authentication mentioned in the flow above, the important OIDC concepts for your application are the &lt;strong&gt;provider configuration&lt;/strong&gt; and &lt;strong&gt;userinfo endpoint&lt;/strong&gt;.&lt;/p&gt;
&lt;/div&gt;&lt;h2&gt;&lt;a href=&quot;https://realpython.com/flask-google-login/?utm_source=realpython&amp;utm_medium=rss&quot;&gt;Read the full article at https://realpython.com/flask-google-login/ »&lt;/a&gt;&lt;/h2&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>AI for Beginners: Use Agents With Confidence</title>
      <id>https://realpython.com/courses/ai-agents-101/</id>
      <link href="https://realpython.com/courses/ai-agents-101/"/>
      <updated>2026-10-26T14:00:00+00:00</updated>
      <summary>Learn how AI agents really work, from models and harnesses to context and skills, so you can get better results and stay in control.</summary>
      <content type="html">
        &lt;p&gt;AI agents don&amp;rsquo;t just answer questions anymore. They read your files, search the web, and take actions on your behalf. In this video course, you&amp;rsquo;ll learn how they really work, from models and harnesses to context and skills, so you can get better results and stay in control.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An AI app is a &lt;strong&gt;model&lt;/strong&gt; that does the thinking, plus a &lt;strong&gt;harness&lt;/strong&gt; that carries out the actions, and many confusing replies come from that split.&lt;/li&gt;
&lt;li&gt;A model works only with what&amp;rsquo;s in its &lt;strong&gt;context&lt;/strong&gt;, so what you hand it shapes every answer.&lt;/li&gt;
&lt;li&gt;Before an agent works for you, you can check &lt;strong&gt;where it runs, what it can touch, what gets sent, and who sees it&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Asking well&lt;/strong&gt; and &lt;strong&gt;starting fresh&lt;/strong&gt; at the right time get you better results and use fewer tokens.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Skills&lt;/strong&gt; let you package a job once and reuse it, and you can build your own.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Along the way, you&amp;rsquo;ll practice in interactive apps and guided mentor sessions, then finish by finding and fixing five problems in an AI assistant&amp;rsquo;s setup.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Codex Live Course:&lt;/strong&gt; Ready to put an agent to work on real code? In Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/codex/&quot;&gt;Codex for Python Developers&lt;/a&gt; live course, you build an entire Python project with Codex, an AI agent that works inside your codebase. The next course runs &lt;strong&gt;November 14 and 15&lt;/strong&gt;!&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: A Practical Introduction to Web Scraping in Python</title>
      <id>https://realpython.com/quizzes/python-web-scraping-practical-introduction/</id>
      <link href="https://realpython.com/quizzes/python-web-scraping-practical-introduction/"/>
      <updated>2026-10-26T12:00:00+00:00</updated>
      <summary>In this quiz, you&#x27;ll test your understanding of web scraping in Python. Web scraping is a powerful tool for data collection and analysis. By working through this quiz, you&#x27;ll revisit how to parse website data using string methods, regular expressions, and HTML parsers, as well as how to interact with forms and other website components.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python-web-scraping-practical-introduction/&quot;&gt;Web Scraping in Python&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to parse website data using string methods and regular expressions, how to parse website data using an HTML parser, and how to interact with forms and other website components.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: How to Use Generators and yield in Python</title>
      <id>https://realpython.com/quizzes/generators-and-yield-in-python/</id>
      <link href="https://realpython.com/quizzes/generators-and-yield-in-python/"/>
      <updated>2026-10-26T12:00:00+00:00</updated>
      <summary>In this quiz, you&#x27;ll test your understanding of Python generators and the yield statement. With this knowledge, you&#x27;ll be able to work with large datasets in a more Pythonic fashion, create generator functions and expressions, and build data pipelines.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of &lt;a href=&quot;https://realpython.com/introduction-to-python-generators/&quot;&gt;Python generators&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Generators and the Python &lt;code&gt;yield&lt;/code&gt; statement can help you when you&amp;rsquo;re working with large datasets that might overwhelm your machine&amp;rsquo;s memory. Another use case is when you have a complex function that needs to maintain an internal state every time it&amp;rsquo;s called.&lt;/p&gt;
&lt;p&gt;When you understand Python generators, then you&amp;rsquo;ll be able to work with large datasets in a more Pythonic fashion, create generator functions and expressions, and apply your knowledge towards building efficient data pipelines.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Working With APIs in Python: Reading Public Data</title>
      <id>https://realpython.com/quizzes/working-apis-reading-public-data/</id>
      <link href="https://realpython.com/quizzes/working-apis-reading-public-data/"/>
      <updated>2026-10-26T12:00:00+00:00</updated>
      <summary>Test your understanding of consuming REST APIs with Requests, from status codes and JSON to query parameters, authentication, and rate limits.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/courses/working-apis-reading-public-data/&quot;&gt;Working With APIs in Python: Reading Public Data&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how requests and responses work, what
common status codes mean, how to read JSON data, how to filter results with query
parameters, and how to authenticate with an API key.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also check how to go easy on an API&amp;rsquo;s servers with pagination and by respecting
rate limits. Once you know these basics, you can start pulling data from almost any
public API into your own projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Managing Python Projects With uv: An All-in-One Solution</title>
      <id>https://realpython.com/quizzes/python-uv/</id>
      <link href="https://realpython.com/quizzes/python-uv/"/>
      <updated>2026-10-26T12:00:00+00:00</updated>
      <summary>In this quiz, you&#x27;ll test your understanding of the uv tool, a high-speed package and project manager for Python.</summary>
      <content type="html">
        &lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how &lt;a href=&quot;https://realpython.com/python-uv/&quot;&gt;Python&amp;rsquo;s uv&lt;/a&gt; integrates multiple functionalities into one tool, offering a comprehensive solution for managing Python projects.&lt;/p&gt;
&lt;p&gt;You can use it for fast dependency installation, virtual environment management, Python version management, and project initialization, enhancing your productivity and efficiency.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Quiz: Python Debugging With Pdb</title>
      <id>https://realpython.com/quizzes/python-debugging-pdb/</id>
      <link href="https://realpython.com/quizzes/python-debugging-pdb/"/>
      <updated>2026-10-25T12:00:00+00:00</updated>
      <summary>Practice using pdb, Python&#x27;s built-in debugger. Check variables, step through code, set conditional breakpoints, and read a stack trace.</summary>
      <content type="html">
        &lt;p&gt;In this quiz, you&amp;rsquo;ll test your understanding of
&lt;a href=&quot;https://realpython.com/python-debugging-pdb/&quot;&gt;Python Debugging With Pdb&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;By working through this quiz, you&amp;rsquo;ll revisit how to print variables and expressions at
the &lt;code&gt;(Pdb)&lt;/code&gt; prompt, step through code with &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;s&lt;/code&gt;, set breakpoints that only fire
when a condition holds, watch expressions as they change, and read a stack trace to find
out which function called the one you&amp;rsquo;re paused in.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #316: The Future of Python Security: Trends, Challenges, and Solutions</title>
      <id>https://realpython.com/podcasts/rpp/316/</id>
      <link href="https://realpython.com/podcasts/rpp/316/"/>
      <updated>2026-10-23T12:00:00+00:00</updated>
      <summary>How is the Python ecosystem adapting to the modern landscape of software security and supply chain defense? This week on the show, we sit down with Seth Larson, the Python Software Foundation&#x27;s Security Developer in Residence.</summary>
      <content type="html">
        &lt;p&gt;How is the Python ecosystem adapting to the modern landscape of software security and supply chain defense? This week on the show, we sit down with Seth Larson, the Python Software Foundation&#x27;s Security Developer in Residence.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Python itertools By Example</title>
      <id>https://realpython.com/courses/python-itertools-by-example/</id>
      <link href="https://realpython.com/courses/python-itertools-by-example/"/>
      <updated>2026-10-21T14:00:00+00:00</updated>
      <summary>Combine Python&#x27;s itertools functions into memory-efficient pipelines as you deal cards, analyze stock data, and pick relay teams.</summary>
      <content type="html">
        &lt;p&gt;Python&amp;rsquo;s &lt;code&gt;itertools&lt;/code&gt; module is one of the hidden gems of the standard library. Knowing the definitions of its functions isn&amp;rsquo;t enough, though. Its real power lies in composing those functions into fast, memory-efficient, and readable code.&lt;/p&gt;
&lt;p&gt;Rather than introducing &lt;code&gt;itertools&lt;/code&gt; one function at a time, this video course works through practical examples that encourage you to think iteratively: you&amp;rsquo;ll shuffle and deal a deck of cards, analyze seventy years of S&amp;amp;P 500 prices, and pick relay teams for a community swim club.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The functions in &lt;code&gt;itertools&lt;/code&gt; &lt;strong&gt;operate on iterators&lt;/strong&gt; and compose into data pipelines that use far less memory than list-based code.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;batched()&lt;/code&gt; is the built-in way to &lt;strong&gt;split an iterable into chunks&lt;/strong&gt;, and it replaces the hand-rolled &lt;code&gt;grouper()&lt;/code&gt; recipe for most jobs.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;combinations()&lt;/code&gt;, &lt;code&gt;permutations()&lt;/code&gt;, and &lt;code&gt;product()&lt;/code&gt; let you &lt;strong&gt;brute-force&lt;/strong&gt; a problem, but they can trigger a combinatorial explosion.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;count()&lt;/code&gt;, &lt;code&gt;repeat()&lt;/code&gt;, &lt;code&gt;cycle()&lt;/code&gt;, and &lt;code&gt;accumulate()&lt;/code&gt; generate &lt;strong&gt;infinite sequences&lt;/strong&gt; and running totals.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pairwise()&lt;/code&gt;, &lt;code&gt;groupby()&lt;/code&gt;, &lt;code&gt;takewhile()&lt;/code&gt;, and &lt;code&gt;dropwhile()&lt;/code&gt; turn real &lt;strong&gt;data analysis&lt;/strong&gt; tasks into short, readable pipelines.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The examples in this video course run on Python 3.15. You&amp;rsquo;ll need Python 3.12 or later for &lt;code&gt;batched()&lt;/code&gt;, and Python 3.15 for unpacking in comprehensions.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Intermediate Python Deep Dive Live Course:&lt;/strong&gt; Want to keep going with iterators and data pipelines? Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/intermediate-deep-dive/&quot;&gt;Intermediate Python Deep Dive&lt;/a&gt; live course covers advanced iteration techniques, special methods, and Python&amp;rsquo;s object model with an instructor and a small cohort. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Tell Your Tech Career Story: Proof, Résumés, and Interviews</title>
      <id>https://realpython.com/courses/tell-your-tech-career-story/</id>
      <link href="https://realpython.com/courses/tell-your-tech-career-story/"/>
      <updated>2026-10-20T14:00:00+00:00</updated>
      <summary>Turn your experience into a clear career story with achievement stories, proof of skills, a tailored résumé, and interview practice with Mentor AI.</summary>
      <content type="html">
        &lt;p&gt;Turn your experience into a clear story that employers notice. Choose a target role, build a bank of honest achievement stories, curate proof of your skills, and write a résumé that you can tailor for a new posting in about thirty minutes. Then practice outreach and interviews in guided mentor sessions, and finish with an application campaign for real postings.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;Free Kit:&lt;/strong&gt; Get the &lt;a href=&quot;https://realpython.com/kits/tech-career-story/&quot;&gt;Tech Career Story Kit&lt;/a&gt; with career folder templates, a quick reference, and quizzes. You only need a free Real Python account.&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Building an AI Agent With LangGraph and Python</title>
      <id>https://realpython.com/courses/building-ai-agent-langgraph-python/</id>
      <link href="https://realpython.com/courses/building-ai-agent-langgraph-python/"/>
      <updated>2026-10-20T14:00:00+00:00</updated>
      <summary>Learn LangGraph in Python with this hands-on video course and build a stateful AI agent using state graphs, nodes, and conditional edges.</summary>
      <content type="html">
        &lt;p&gt;LangGraph is a versatile Python framework designed for stateful, cyclic, and multi-actor Large Language Model (LLM) applications. LangGraph builds on its parent library, LangChain, and allows you to build sophisticated workflows that can handle the complexities of real-world LLM applications. Throughout this LangGraph video course, you&amp;rsquo;ll build a complete email-processing agent from the ground up.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this video course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can use LangGraph to build LLM workflows by &lt;strong&gt;defining state graphs with nodes and edges&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;LangGraph extends LangChain&amp;rsquo;s capabilities by enabling complex LLM workflows with &lt;strong&gt;state, conditional edges, and cycles&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;LLM agents&lt;/strong&gt; in LangGraph autonomously process tasks by using state graphs to make decisions and interact with tools or APIs.&lt;/li&gt;
&lt;li&gt;You can use LangGraph independently of LangChain, though they&amp;rsquo;re often used together to complement each other.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Follow along with the full video course to gain hands-on experience with LangGraph, including setting up workflows and building a LangGraph agent that can autonomously parse and send emails and interact with API services.&lt;/p&gt;
&lt;p&gt;While you&amp;rsquo;ll get a brief primer on &lt;a href=&quot;https://realpython.com/build-llm-rag-chatbot-with-langchain/&quot;&gt;LangChain&lt;/a&gt; in this course, you&amp;rsquo;ll benefit from prior knowledge of LangChain fundamentals. You&amp;rsquo;ll also want to ensure you have intermediate Python knowledge, specifically in &lt;a href=&quot;https://realpython.com/python3-object-oriented-programming/&quot;&gt;object-oriented programming&lt;/a&gt; concepts like classes and methods.&lt;/p&gt;
&lt;div class=&quot;alert alert-primary&quot; role=&quot;alert&quot;&gt;
&lt;p&gt;&lt;strong&gt;AI Agent From Scratch Live Course:&lt;/strong&gt; Want to see what LangGraph does for you under the hood? In Real Python&amp;rsquo;s &lt;a href=&quot;https://realpython.com/workshops/agentic-loops/&quot;&gt;Build an AI Agent From Scratch in Python&lt;/a&gt; live course, you write the agent loop by hand, then recognize every piece of it in the tools you already use. Join the waitlist to hear about the next dates.&lt;/p&gt;
&lt;/div&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #315: Python Pitfalls: Common Mistakes and How to Avoid Them</title>
      <id>https://realpython.com/podcasts/rpp/315/</id>
      <link href="https://realpython.com/podcasts/rpp/315/"/>
      <updated>2026-10-16T12:00:00+00:00</updated>
      <summary>What are common mistakes that Python beginners make, and how do you avoid them? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are common mistakes that Python beginners make, and how do you avoid them? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>How to Use Python: Taking Your First Steps</title>
      <id>https://realpython.com/courses/python-first-steps/</id>
      <link href="https://realpython.com/courses/python-first-steps/"/>
      <updated>2026-10-13T14:00:00+00:00</updated>
      <summary>Take your first steps with Python. Install it, run your first program, and work with variables, data types, loops, functions, and errors.</summary>
      <content type="html">
        &lt;p&gt;If you&amp;rsquo;re starting fresh with programming and wondering how to use Python, this video course will give you the foundation you need to get started with Python step by step. You&amp;rsquo;ll learn how to install Python, run your first program, and understand the language&amp;rsquo;s clear syntax.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll also explore variables, loops, functions, classes, and error handling while discovering tools, coding style, and libraries that help you write effective Python code from day one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;By the end of this course, you&amp;rsquo;ll understand that:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can &lt;strong&gt;install Python&lt;/strong&gt; on Windows, macOS, and Linux using binaries, package managers, or distributions like Anaconda.&lt;/li&gt;
&lt;li&gt;You can use the &lt;strong&gt;Python REPL&lt;/strong&gt; to experiment &lt;strong&gt;interactively&lt;/strong&gt; before writing full scripts, modules, and projects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Built-in data types&lt;/strong&gt; like strings, lists, dictionaries, and sets provide powerful ways to structure information.&lt;/li&gt;
&lt;li&gt;You can &lt;strong&gt;handle errors&lt;/strong&gt; with syntax checks, exceptions, and debugging practices to keep your code running smoothly.&lt;/li&gt;
&lt;li&gt;Tools like &lt;strong&gt;editors&lt;/strong&gt;, &lt;strong&gt;integrated development environments (IDEs)&lt;/strong&gt;, and &lt;strong&gt;AI assistants&lt;/strong&gt; can boost your productivity when writing Python code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;rsquo;ll take your first steps with clear examples so you can start coding in Python confidently and build on solid ground.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #314: Codemoo: Demonstrating How Coding Agents Work</title>
      <id>https://realpython.com/podcasts/rpp/314/</id>
      <link href="https://realpython.com/podcasts/rpp/314/"/>
      <updated>2026-10-09T12:00:00+00:00</updated>
      <summary>How do you assemble the core pieces of a coding agent? How are developers defining projects through conversation and introspection? This week on the show, Geir Arne Hjelle returns to talk about his recent project to demonstrate how coding agents work under the hood.</summary>
      <content type="html">
        &lt;p&gt;How do you assemble the core pieces of a coding agent? How are developers defining projects through conversation and introspection? This week on the show, Geir Arne Hjelle returns to talk about his recent project to demonstrate how coding agents work under the hood.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Exploring the MVC Pattern in Python</title>
      <id>https://realpython.com/courses/exploring-mvc-pattern-python/</id>
      <link href="https://realpython.com/courses/exploring-mvc-pattern-python/"/>
      <updated>2026-10-06T14:00:00+00:00</updated>
      <summary>Learn how the Model-View-Controller pattern organizes Python web apps, then build a small Flask app using models, views, and controllers.</summary>
      <content type="html">
        &lt;p&gt;If you&amp;rsquo;re curious about web development, then you&amp;rsquo;ve likely encountered the abbreviation &lt;strong&gt;MVC&lt;/strong&gt;, which stands for &lt;a href=&quot;https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller&quot;&gt;Model-View-Controller&lt;/a&gt;. You may know that it&amp;rsquo;s a common design pattern that&amp;rsquo;s fundamental to many Python web frameworks and even desktop applications.&lt;/p&gt;
&lt;p&gt;But what exactly does it mean? If you&amp;rsquo;ve had a hard time wrapping your head around the concept, then this video course is for you.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Learn what &lt;strong&gt;models&lt;/strong&gt;, &lt;strong&gt;views&lt;/strong&gt;, and &lt;strong&gt;controllers&lt;/strong&gt; are &lt;strong&gt;conceptually&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Follow a &lt;strong&gt;user&amp;rsquo;s request&lt;/strong&gt; through an MVC application from end to end&lt;/li&gt;
&lt;li&gt;Tie your conceptual understanding back to &lt;strong&gt;concrete web development examples&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Build a small &lt;strong&gt;Flask&lt;/strong&gt; app that puts the MVC pattern into practice&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #313: Python 3.15: Exploring the New Features</title>
      <id>https://realpython.com/podcasts/rpp/313/</id>
      <link href="https://realpython.com/podcasts/rpp/313/"/>
      <updated>2026-10-02T12:00:00+00:00</updated>
      <summary>Python 3.15 is (almost*) here! Christopher Trudeau and Bartosz Zaczyński return to discuss the new version. Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.15: Cool New Features for You to Try.&quot; Christopher&#x27;s video course &quot;What&#x27;s New in Python 3.15&quot; covers the topics from the article and shows the new features in action.</summary>
      <content type="html">
        &lt;p&gt;Python 3.15 is (almost*) here! Christopher Trudeau and Bartosz Zaczyński return to discuss the new version. Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, &quot;Python 3.15: Cool New Features for You to Try.&quot; Christopher&#x27;s video course &quot;What&#x27;s New in Python 3.15&quot; covers the topics from the article and shows the new features in action.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Community Videos</title>
      <id>https://realpython.com/courses/community-videos/</id>
      <link href="https://realpython.com/courses/community-videos/"/>
      <updated>2026-09-30T14:00:00+00:00</updated>
      <summary>Watch Real Python&#x27;s YouTube videos right here on the site, with the resources mentioned in each video and a full transcript.</summary>
      <content type="html">
        &lt;p&gt;This collection gathers the videos that the Real Python team published on the &lt;a href=&quot;https://www.youtube.com/@realpython&quot;&gt;Real Python YouTube channel&lt;/a&gt;, so you can watch them right here on Real Python.&lt;/p&gt;
&lt;p&gt;Each lesson contains the full video, the resources mentioned in it, and a transcript. The newest video is always at the top, and new videos are added as they&amp;rsquo;re released.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>What&#x27;s New in Python 3.15</title>
      <id>https://realpython.com/courses/whats-new-in-python-315/</id>
      <link href="https://realpython.com/courses/whats-new-in-python-315/"/>
      <updated>2026-09-29T14:00:00+00:00</updated>
      <summary>Explore the new features in Python 3.15, including lazy imports, frozendict, sentinel values, a sampling profiler, and a faster JIT.</summary>
      <content type="html">
        &lt;p&gt;Python 3.15 is here! After a last-minute third release candidate, the &lt;a href=&quot;https://www.python.org/downloads/release/python-3150/&quot;&gt;final release&lt;/a&gt; came out on October 9, 2026, so you can install it today and start using the new features in your own code. This is a good time to see what the new version has in store for you.&lt;/p&gt;
&lt;p&gt;This release trims the time you spend waiting. Imports can wait until you need them, the JIT compiler got faster, and a new profiler shows you where the remaining slow parts hide. There&amp;rsquo;s also plenty in it for everyday code, including two new built-in types.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In this video course, you&amp;rsquo;ll explore features like:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Lazy imports&lt;/strong&gt; with the new &lt;code&gt;lazy&lt;/code&gt; keyword&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;frozendict&lt;/code&gt;&lt;/strong&gt;, an immutable mapping in the built-ins&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;sentinel&lt;/code&gt;&lt;/strong&gt;, a clean way to say &amp;ldquo;no value given&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A sampling profiler&lt;/strong&gt; that you can point at a running process&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UTF-8&lt;/strong&gt; as the default encoding everywhere&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An upgraded JIT compiler&lt;/strong&gt; with measurable speedups&lt;/li&gt;
&lt;/ul&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #312: Navigating AI in Open Source: Insights From Wagtail</title>
      <id>https://realpython.com/podcasts/rpp/312/</id>
      <link href="https://realpython.com/podcasts/rpp/312/"/>
      <updated>2026-09-25T12:00:00+00:00</updated>
      <summary>How should you manage AI contributions to an open-source project? How do you measure the impact of using AI tools for development, and what generative features do end users want from a content management system? This week on the show, we speak with Thibaud Colas and Meagen Voss from Wagtail about the complex considerations software organizations are currently facing.</summary>
      <content type="html">
        &lt;p&gt;How should you manage AI contributions to an open-source project? How do you measure the impact of using AI tools for development, and what generative features do end users want from a content management system? This week on the show, we speak with Thibaud Colas and Meagen Voss from Wagtail about the complex considerations software organizations are currently facing.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Using the Claude API in Python</title>
      <id>https://realpython.com/courses/using-claude-api-python/</id>
      <link href="https://realpython.com/courses/using-claude-api-python/"/>
      <updated>2026-09-22T14:00:00+00:00</updated>
      <summary>Learn how to use the Claude API in Python to send prompts, control responses with system instructions, and get structured output.</summary>
      <content type="html">
        &lt;p&gt;The fastest way to use the Claude API in Python is to install &lt;code&gt;anthropic&lt;/code&gt;, set your API key, and call &lt;code&gt;client.messages.create()&lt;/code&gt;. You&amp;rsquo;ll have a working response in under a minute.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/ref/ai-coding-tools/claude/&quot; class=&quot;ref-link&quot;&gt;Claude&lt;/a&gt; is Anthropic&amp;rsquo;s &lt;a href=&quot;/ref/ai-coding-glossary/llm/&quot; class=&quot;ref-link&quot;&gt;large language model&lt;/a&gt;, accessible via a clean &lt;a href=&quot;https://realpython.com/api-integration-in-python/&quot;&gt;REST API&lt;/a&gt; with an official Python SDK. Unlike heavier AI frameworks that require you to wire up multiple components before you see any output, the &lt;code&gt;anthropic&lt;/code&gt; package gets you to a working response in a handful of lines.&lt;/p&gt;
&lt;p&gt;In this video course, you&amp;rsquo;ll install the &lt;code&gt;anthropic&lt;/code&gt; SDK, call Claude from Python, shape Claude&amp;rsquo;s behavior with a &lt;a href=&quot;/ref/ai-coding-glossary/system-prompt/&quot; class=&quot;ref-link&quot;&gt;system prompt&lt;/a&gt;, and then return structured &lt;a href=&quot;https://realpython.com/python-json/&quot;&gt;JSON&lt;/a&gt; output using &lt;a href=&quot;https://realpython.com/python-pydantic/&quot;&gt;Pydantic&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Claude&amp;rsquo;s responses are non-deterministic, so the same prompt produces different output each time, which is expected for a large language model. Also, API calls cost money based on the number of &lt;a href=&quot;/ref/ai-coding-glossary/token/&quot; class=&quot;ref-link&quot;&gt;tokens&lt;/a&gt; processed. Keep an eye on your usage in the Claude Console as you follow along.&lt;/p&gt;
&lt;p&gt;Each lesson builds on the last, and the final script is short enough to read in one sitting but complete enough to extend into a real application of your own.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #311: Django Developers Survey Results &amp; Reproducible Python Builds</title>
      <id>https://realpython.com/podcasts/rpp/311/</id>
      <link href="https://realpython.com/podcasts/rpp/311/"/>
      <updated>2026-09-11T12:00:00+00:00</updated>
      <summary>What are the latest trends uncovered in the 2026 Django Developers Survey? How are Django users employing LLMs in their development process? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are the latest trends uncovered in the 2026 Django Developers Survey? How are Django users employing LLMs in their development process? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #310: Performance Engineering: Profiling and Making Apps Fast by Default</title>
      <id>https://realpython.com/podcasts/rpp/310/</id>
      <link href="https://realpython.com/podcasts/rpp/310/"/>
      <updated>2026-09-04T12:00:00+00:00</updated>
      <summary>How do you plan for the performance of your Python applications? What does a performance budget entail, and where should you spend your resources? This week on the show, we speak with Den Odell about his new book &quot;Fast by Default: Practical Performance Engineering.&quot;</summary>
      <content type="html">
        &lt;p&gt;How do you plan for the performance of your Python applications? What does a performance budget entail, and where should you spend your resources? This week on the show, we speak with Den Odell about his new book &quot;Fast by Default: Practical Performance Engineering.&quot;&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #309: Exploring Complex Systems &amp; Maintainable Data Science Pipelines</title>
      <id>https://realpython.com/podcasts/rpp/309/</id>
      <link href="https://realpython.com/podcasts/rpp/309/"/>
      <updated>2026-08-28T12:00:00+00:00</updated>
      <summary>What are the key characteristics of complex systems, and what are practical patterns for tackling complex coding problems? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What are the key characteristics of complex systems, and what are practical patterns for tackling complex coding problems? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #308: Navigating Silent Failures in AI: Strategies for Effective Oversight</title>
      <id>https://realpython.com/podcasts/rpp/308/</id>
      <link href="https://realpython.com/podcasts/rpp/308/"/>
      <updated>2026-08-21T12:00:00+00:00</updated>
      <summary>Why do AI systems silently fail? How can you set up a system that produces results while also reviewing and validating the work? This week on the show, Calvin Hendryx-Parker returns to discuss his recent talk &quot;Orchestrate Agentic AI: Context, Checklists, and No-Miss Reviews.&quot;</summary>
      <content type="html">
        &lt;p&gt;Why do AI systems silently fail? How can you set up a system that produces results while also reviewing and validating the work? This week on the show, Calvin Hendryx-Parker returns to discuss his recent talk &quot;Orchestrate Agentic AI: Context, Checklists, and No-Miss Reviews.&quot;&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>The Real Python Podcast – Episode #307: Improving NumPy Performance on Free-Threaded Python</title>
      <id>https://realpython.com/podcasts/rpp/307/</id>
      <link href="https://realpython.com/podcasts/rpp/307/"/>
      <updated>2026-08-14T12:00:00+00:00</updated>
      <summary>What bottlenecks were preventing NumPy from scaling on free-threaded Python? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.</summary>
      <content type="html">
        &lt;p&gt;What bottlenecks were preventing NumPy from scaling on free-threaded Python? Christopher Trudeau is back on the show this week with another batch of PyCoder&#x27;s Weekly articles and projects.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: FastAPI: Python API Development With Light Speed</title>
      <id>https://realpython.com/learning-paths/fastapi/</id>
      <link href="https://realpython.com/learning-paths/fastapi/"/>
      <updated>2026-07-22T12:00:00+00:00</updated>
      <summary>Learn FastAPI from the ground up. Build REST APIs, serve web pages with Jinja2 templates, and create a complete URL shortener project in Python.</summary>
      <content type="html">
        &lt;p&gt;Learn FastAPI from the ground up. Build REST APIs, serve web pages with Jinja2 templates, and create a complete URL shortener project in Python.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Python Game Development</title>
      <id>https://realpython.com/learning-paths/python-game-development/</id>
      <link href="https://realpython.com/learning-paths/python-game-development/"/>
      <updated>2026-04-16T12:00:00+00:00</updated>
      <summary>Build Python games from command-line projects to 2D graphical games with turtle, Tkinter, Pygame, and Arcade.</summary>
      <content type="html">
        &lt;p&gt;Build Python games from command-line projects to 2D graphical games with turtle, Tkinter, Pygame, and Arcade.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: LLM Application Development With Python</title>
      <id>https://realpython.com/learning-paths/llm-application-development-python/</id>
      <link href="https://realpython.com/learning-paths/llm-application-development-python/"/>
      <updated>2026-03-19T12:00:00+00:00</updated>
      <summary>Build LLM-powered applications in Python. Call model APIs, craft prompts, add retrieval-augmented generation, create AI agents, and connect via MCP.</summary>
      <content type="html">
        &lt;p&gt;Build LLM-powered applications in Python. Call model APIs, craft prompts, add retrieval-augmented generation, create AI agents, and connect via MCP.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Python Coding With AI</title>
      <id>https://realpython.com/learning-paths/coding-with-ai/</id>
      <link href="https://realpython.com/learning-paths/coding-with-ai/"/>
      <updated>2025-12-07T12:00:00+00:00</updated>
      <summary>Use AI coding assistants to write, review, and debug Python code faster. Choose an editor-based assistant like Cursor or a terminal-based one like Claude Code, then make it part of your daily workflow.</summary>
      <content type="html">
        &lt;p&gt;Use AI coding assistants to write, review, and debug Python code faster. Choose an editor-based assistant like Cursor or a terminal-based one like Claude Code, then make it part of your daily workflow.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Ace Your Python Coding Interview</title>
      <id>https://realpython.com/learning-paths/python-interview/</id>
      <link href="https://realpython.com/learning-paths/python-interview/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Prepare for Python coding interviews with practice problems, tips for standing out, and resources from top PyCon talks and Python books.</summary>
      <content type="html">
        &lt;p&gt;Prepare for Python coding interviews with practice problems, tips for standing out, and resources from top PyCon talks and Python books.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Create Graphical User Interfaces (GUI)</title>
      <id>https://realpython.com/learning-paths/python-gui-programming/</id>
      <link href="https://realpython.com/learning-paths/python-gui-programming/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Build Python GUI applications with Tkinter, PyQt, wxPython, and Kivy. Learn layouts, event handling, threading, and database integration.</summary>
      <content type="html">
        &lt;p&gt;Build Python GUI applications with Tkinter, PyQt, wxPython, and Kivy. Learn layouts, event handling, threading, and database integration.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Python Data Structures</title>
      <id>https://realpython.com/learning-paths/basic-python-data-structures/</id>
      <link href="https://realpython.com/learning-paths/basic-python-data-structures/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Learn Python&#x27;s built-in data structures: strings, lists, tuples, dictionaries, sets, and bytes, plus sorting, copying, and comprehensions.</summary>
      <content type="html">
        &lt;p&gt;Learn Python&#x27;s built-in data structures: strings, lists, tuples, dictionaries, sets, and bytes, plus sorting, copying, and comprehensions.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Testing and Continuous Integration</title>
      <id>https://realpython.com/learning-paths/test-your-python-apps/</id>
      <link href="https://realpython.com/learning-paths/test-your-python-apps/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Learn how to test Python code with unittest, doctest, pytest, and mock objects. Set up continuous integration with GitHub Actions and Docker.</summary>
      <content type="html">
        &lt;p&gt;Learn how to test Python code with unittest, doctest, pytest, and mock objects. Set up continuous integration with GitHub Actions and Docker.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Exceptions, Logging, and Debugging</title>
      <id>https://realpython.com/learning-paths/exception-handling-logging-debugging/</id>
      <link href="https://realpython.com/learning-paths/exception-handling-logging-debugging/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Learn Python exception handling, logging, and debugging. Work with raise, built-in exceptions, the logging module, and pdb to write reliable code.</summary>
      <content type="html">
        &lt;p&gt;Learn Python exception handling, logging, and debugging. Work with raise, built-in exceptions, the logging module, and pdb to write reliable code.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  
    <entry>
      <title>Learning Path: Important Standard Library Modules</title>
      <id>https://realpython.com/learning-paths/standard-library-modules-you-should-know/</id>
      <link href="https://realpython.com/learning-paths/standard-library-modules-you-should-know/"/>
      <updated>2024-11-14T12:00:00+00:00</updated>
      <summary>Explore Python standard library modules including math, datetime, JSON, CSV, regex, subprocess, and argparse through hands-on tutorials and courses.</summary>
      <content type="html">
        &lt;p&gt;Explore Python standard library modules including math, datetime, JSON, CSV, regex, subprocess, and argparse through hands-on tutorials and courses.&lt;/p&gt;
        &lt;hr /&gt;
        &lt;p&gt;&lt;em&gt;[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short &amp;amp; sweet Python Trick delivered to your inbox every couple of days. &lt;a href=&quot;https://realpython.com/python-tricks/?utm_source=realpython&amp;amp;utm_medium=rss&amp;amp;utm_campaign=footer&quot;&gt;&amp;gt;&amp;gt; Click here to learn more and see examples&lt;/a&gt; ]&lt;/em&gt;&lt;/p&gt;
      </content>
    </entry>
  

</feed>
