The Real Python Podcast

Pydantic Data Validation & Python Web Security Practices


Listen Later

How do you verify and validate the data coming into your Python web application? What tools and security best practices should you consider as a developer? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.

We discuss the recent Real Python tutorial “Pydantic: Simplifying Data Validation in Python.” The piece covers installing the library with optional dependencies, working with base models, validating functions, and managing environment variables.

We continue our conversation about web development with another article about Python security best practices. This article covers several Python libraries and crucial steps you can take to help make your web-based applications more secure.

We also share several other articles and projects from the Python community, including a news roundup, why Python lists multiply oddly, inline run dependencies in pipx, a discussion about open-source contribution assignments, playing sounds in Python, and a Python library to access ISO country definitions.

This episode is sponsored by Mailtrap.

Course Spotlight: Using raise for Effective Exceptions

In this video course, you’ll learn how to raise exceptions in Python, which will improve your ability to efficiently handle errors and exceptional situations in your code. This way, you’ll write more reliable, robust, and maintainable code.

Topics:

  • 00:00:00 – Introduction
  • 00:02:40 – Python 3.12.3, Python 3.11.9, and 3.13.0a6 Released
  • 00:03:43 – Django Bugfix Release Issued: 5.0.4
  • 00:04:48 – PEP 738 Accepted: Adding Android as a Supported Platform
  • 00:05:53 – EuroPython Tickets on Sale: Prague/Remote July 8-14
  • 00:06:38 – PyCon Portugal 2024
  • 00:07:17 – Pydantic: Simplifying Data Validation in Python
  • 00:15:24 – Sponsor: Mailtrap
  • 00:15:58 – Why Do Python Lists Multiply Oddly?
  • 00:22:21 – Best Python Security Practices for Web Developers
  • 00:34:13 – Video Course Spotlight
  • 00:35:38 – Inline Run Dependencies in pipx 1.4.2
  • 00:40:16 – So Your Teacher Wants You to Do Open Source
  • 00:54:49 – nava: Play Sounds in Python
  • 00:56:25 – pycountry: A Python library to access ISO country definitions
  • 00:58:18 – Thanks and goodbye
  • News:

    • Python 3.12.3 and 3.13.0a6 Released
    • Python 3.11.9 Released
    • Django Bugfix Release Issued: 5.0.4
    • PEP 738 Accepted: Adding Android as a Supported Platform
    • PEP 742 Accepted: Narrowing Types With TypeIs
    • EuroPython Tickets on Sale: Prague/Remote July 8-14
    • PyCon Portugal 2024
    • Show Links:

      • Pydantic: Simplifying Data Validation in Python – Discover the power of Pydantic, Python’s most popular data parsing, validation, and serialization library. In this hands-on tutorial, you’ll learn how to make your code more robust, trustworthy, and easier to debug with Pydantic.
      • Why Do Python Lists Multiply Oddly? – In Python you can use the multiplication operator on sequences to return a repeated version of the value. When you do this with a list containing an empty list you get what might be unexpected behavior. This article explains what happens and why.
      • Best Python Security Practices for Web Developers – Coding on the web means you have to be more security conscious as everyone has access to your software. This article discusses key steps you can take to help make your code more secure.
      • Inline Run Dependencies in pipx 1.4.2PEP 723 adds the ability to specify dependencies within a Python script itself. The folks who write pipx have added an experimental feature that takes advantage of this future language change. This article shows you how the new feature looks and what pipx does with it.
      • Install and Execute Python Applications Using pipx – In this tutorial, you’ll learn about a tool called pipx, which lets you conveniently install and run Python packages as standalone command-line applications in isolated environments. In a way, pipx turns the Python Package Index (PyPI) into an app marketplace for Python programmers.
      • Discussion:

        • So Your Teacher Wants You to Do Open Source – Sometimes teachers or mentors ask students to contribute to an open source project, without the context of what that entails. This opinion piece covers just how much noise that causes for the projects and why you shouldn’t do it unless you truly mean to contribute.
        • 503 Days Working Full-Time on FOSS: Lessons Learned – For a year and a half, Rodrigo worked at Textualize the company behind the popular open source Python projects Rich and Textual. This blog post talks about what he learned while he was there.
        • Projects:

          • nava: Play Sounds in Python
          • pycountry: A Python library to access ISO country, subdivision, language, currency and script definitions and their translations
          • Additional Links:

            • Pydantic
            • François Fleuret on X: “2h of debugging. Whatever you say, that’s counter intuitive.”
            • bandit: Security oriented static analyzer for Python code - PyPI
            • Dependency Management With Python Poetry – Real Python
            • OWASP Top Ten - OWASP Foundation
            • pipx
            • Governance - The Pallets Projects
            • Textual
            • How to Contribute to Open Source - Open Source Guides
            • Djangonaut Space - Where contributors launch!
            • Level up your Python skills with our expert-led courses:

              • Lists and Tuples in Python
              • Using raise for Effective Exceptions
              • Sorting Data in Python With pandas
              • Support the podcast & join our community of Pythonistas

                ...more
                View all episodesView all episodes
                Download on the App Store

                The Real Python PodcastBy Real Python

                • 4.7
                • 4.7
                • 4.7
                • 4.7
                • 4.7

                4.7

                136 ratings


                More shows like The Real Python Podcast

                View all
                Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

                Software Engineering Radio - the podcast for professional software developers

                272 Listeners

                The Changelog: Software Development, Open Source by Changelog Media

                The Changelog: Software Development, Open Source

                283 Listeners

                Data Skeptic by Kyle Polich

                Data Skeptic

                481 Listeners

                Talk Python To Me by Michael Kennedy

                Talk Python To Me

                592 Listeners

                Software Engineering Daily by Software Engineering Daily

                Software Engineering Daily

                624 Listeners

                The TWIML AI Podcast (formerly This Week in Machine Learning & Artificial Intelligence) by Sam Charrington

                The TWIML AI Podcast (formerly This Week in Machine Learning & Artificial Intelligence)

                443 Listeners

                Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

                Super Data Science: ML & AI Podcast with Jon Krohn

                296 Listeners

                Python Bytes by Michael Kennedy and Brian Okken

                Python Bytes

                213 Listeners

                Data Engineering Podcast by Tobias Macey

                Data Engineering Podcast

                142 Listeners

                Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

                Syntax - Tasty Web Development Treats

                982 Listeners

                CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

                CoRecursive: Coding Stories

                189 Listeners

                DataFramed by DataCamp

                DataFramed

                266 Listeners

                Practical AI by Practical AI LLC

                Practical AI

                189 Listeners

                The Stack Overflow Podcast by The Stack Overflow Podcast

                The Stack Overflow Podcast

                64 Listeners

                Latent Space: The AI Engineer Podcast by swyx + Alessio

                Latent Space: The AI Engineer Podcast

                77 Listeners