The Real Python Podcast

Real Python
undefined
Aug 7, 2020 • 1h 1min

Exploring K-means Clustering and Building a Gradebook With Pandas

Join David Amos, a regular contributor and Python aficionado from PyCoder's Weekly, as he dives into K-means clustering techniques in Python. Discover how this powerful method can be applied to real-world data, including automating grade calculations with a gradebook using pandas. The conversation also unpacks intriguing topics like JPEG image decoding, advanced object-oriented programming, and a selection of helpful Python packages. It's an enlightening mix that sparks joy in the world of coding!
undefined
Jul 31, 2020 • 53min

Building PDFs in Python with ReportLab

Have you wanted to generate advanced reports as PDFs using Python? Maybe you want to build documents with tables, images, or fillable forms. This week on the show we have Mike Driscoll to talk about his book “ReportLab - PDF Processing with Python.” Mike is an author of multiple books about Python, and has recently re-written his Python 101 book. He is also a member of the Real Python team and has written several articles for the site. Along with our discussion about ReportLab and PDFs, Mike talks about being a self-published author. We also talk briefly about his favorite Python GUI framework. Course Spotlight: How to Work With a PDF in Python In this step-by-step course, you’ll learn how to work with a PDF in Python. You’ll see how to extract metadata from preexisting PDFs. You’ll also learn how to merge, split, watermark, and rotate pages in PDFs using Python and PyPDF2. Topics: 00:00:00 – Introduction 00:01:23 – Python 101 book revisions/rewrite 00:04:48 – Python 201 book 00:05:47 – What Python GUI framework do you prefer? 00:12:46 – MouseVsPython YouTube channel 00:14:34 – Why write a ReportLab book? 00:16:11 – Kickstarter and self-publishing books 00:21:38 – Reader feedback about the book 00:22:35 – What other PDF tools are covered in the book? 00:23:48 – Differences with ReportLab Plus 00:25:00 – Flowables and PLATYPUS 00:28:56 – Video Course Spotlight 00:29:49 – What types of projects have you used ReportLab for? 00:35:50 – Creating PDF forms with ReportLab 00:40:21 – LaTeX comparison with ReportLab 00:41:40 – PDFMiner text extraction 00:43:17 – PyFPDF Library for PDF document creation 00:45:28 – Camelot: PDF Table Extraction for Humans 00:47:17 – Working with passwords and encryption - PyPDF2 00:47:56 – What are you excited about in the world of Python? 00:48:47 – Learning OpenCV 00:49:38 – What do you want to learn next in Python? 00:50:20 – Suggestions for Python libraries to read 00:52:11 – Thanks and Goodbye Show links: MouseVsPython Blog Python 101: 2nd Edition – Leanpub Python 201: Intermediate Python – Leanpub How to Build a Python GUI Application With wxPython – Real Python article wxPython Recipes: A Problem - Solution Approach – Apress wxPython: The GUI Toolkit for Python PySimpleGUI: The Simple Way to Create a GUI With Python – Real Python article PySimpleGUI: Python GUI For Humans Mouse Vs Python: YouTube channel ReportLab - PDF Processing with Python – Leanpub ReportLab: Developer pages - Open Source LaTeX – Document preparation system PDFMiner: Text extraction tool for PDF documents PyFPDF: Library for PDF document generation under Python Camelot: PDF Table Extraction for Humans PyPDF2: Pure-Python library built as a PDF toolkit How to Work With a PDF in Python – Real Python article PyViz: List of libraries for visualizing data in Python Adrian Rosebrock: author page – pyimagesearch.com OpenCV Tutorials, Resources, and Guides - pyimagesearch.com Image Segmentation Using Color Spaces in OpenCV + Python – Real Python article Pillow: The friendly PIL (Python Imaging Library) fork Three Ways of Storing and Accessing Lots of Images in Python – Real Python article Level up your Python skills with our expert-led courses: Interactive Data Visualization With Bokeh and Python How to Work With a PDF in Python Histogram Plotting in Python: NumPy, Matplotlib, Pandas & Seaborn Support the podcast & join our community of Pythonistas
undefined
Jul 24, 2020 • 52min

Advanced Python Import Techniques and Managing Users in Django

Would you like to clearly understand what’s happening when you use the Python import keyword? Do you want to use modules more effectively to structure your code? Or maybe you’re ready to move to the next level with your Django project by adding user management. This week on the show, David Amos is back with another batch of PyCoder’s Weekly articles and projects. We discuss a Real Python article about advanced techniques and tips for using the Python import keyword. David also talks about another recent article on the site about managing users in Django. We cover several other articles and projects from the Python community including: robot programming in Python, f-strings vs .format(), the rise of Python malware, a hardware Python keyboard, and more. Course Spotlight: Grow Your Python Portfolio With 13 Intermediate Project Ideas Get started on 13 Python project ideas that are just right for intermediate Python developers. They’ll challenge you enough to help you become a better Pythonista. Topics: 00:00:00 – Introduction 00:01:31 – The Non-Return of the Python print statement 00:05:46 – Python Malware on the Rise 00:13:46 – Get Started With Django Part 2: Django User Management 00:19:01 – Why Do People Use .format() When f-Strings Exist? 00:27:41 – Video Course Spotlight 00:28:45 – A Beginner’s Guide to Robot Programming With Python 00:36:17 – Python import: Advanced Techniques and Tips 00:40:56 – toolz: A Functional Standard Library for Python 00:46:43 – python-keyboard: A Hand-Wired USB & BLE Keyboard Powered by Python 00:51:09 – Thanks and Goodbye Show Links: The (Non-)Return of the Python Print Statement – Guido van Rossum recently proposed re-introducing the Python print statement. He was completely serious and even though the idea didn’t gain traction, it’s interesting to know why he made the proposal. Python Malware on the Rise – Python’s low barrier to entry, enormous ecosystem, and rapid development process has made it one of he most desired programming languages for millions of developers around he globe—including malicious actors. Read the article at the link above and follow the discussion on Hacker News. Get Started With Django Part 2: Django User Management – In this step-by-step tutorial, you’ll learn how to extend your Django application with a user management system, complete with email sending and third-party authentication. Why Do People Use .format() When f-Strings Exist? – f-Strings aren’t exactly a drop-in replacement for .format(). A Beginner’s Guide to Robot Programming With Python – Get a crash course in programming autonomous robots with Python. Don’t have a robot laying around? No problem! Use this open-source simulator to get started. Python import: Advanced Techniques and Tips – The Python import system is as powerful as it is useful. In this in-depth tutorial, you’ll learn how to harness this power to improve the structure and maintainability of your code. Projects: toolz: A Functional Standard Library for Python python-keyboard: A Hand-Wired USB & BLE Keyboard Powered by Python Additional Links: Finding secrets by decompiling Python bytecode in public repositories Python String Formatting Best Practices: Real Python article Remapping Python Opcodes Big Trak Introduction to Decorators: Power Up Your Python Code - PyCon 2020 Tutorial M60 Mechanical Keyboard Level up your Python skills with our expert-led courses: Getting Started With Django: Building a Portfolio App Python 3's F-Strings: An Improved String Formatting Syntax Python Modules and Packages: An Introduction Support the podcast & join our community of Pythonistas
undefined
Jul 17, 2020 • 1h 17min

Ten Years of Flask: Conversation With Creator Armin Ronacher

This week on the show we have Armin Ronacher to talk about the first 10 years of Flask. Armin talks about the origins of Flask and the components that make up the framework. He talks about what goes into documenting a framework or API. He also talks about the community working on the ongoing development of Flask. He also shares his thoughts about Python, and how it contrasts with Rust and TypeScript. Armin talks about what he would do differently if he were to start development of a project like Flask now. Course Spotlight: Documenting Python Code: A Complete Guide This course will get you up to speed with how to document your Python code. Documenting your code is an important step to help developers and users fully understand its usage and purpose. Topics: 00:00:00 – Introduction 00:01:21 – Director of Engineering at Sentry 00:07:27 – How much are you currently involved with Flask? 00:08:32 – Are you still using both Python and Rust currently? 00:11:37 – The origins of Flask 00:19:14 – Initial reactions and focus 00:21:26 – Where has Jinja use shifted? 00:23:23 – Flask usage trends 00:25:44 – The Pallets Projects name 00:29:08 – Flask version numbers 00:34:21 – Video Course Spotlight 00:35:21 – The community working on Flask 00:38:18 – Thoughts on type checking 00:41:40 – Flask’s documentation 00:43:26 – Thoughts on API documentation 00:47:27 – What would you change if you started from scratch? 00:49:58 – Listener question about using Python with WordPress 00:58:15 – Any suggestions of a Python project source code to read? 01:00:13 – Revisit - What would you change if you started from scratch? 01:03:17 – Thoughts on the current path of Python 01:06:20 – What are you excited about in the world of Python? 01:07:44 – What do you want to learn next? 01:11:35 – Thoughts on conferences and speaking 01:16:19 – Thanks and Conclusion Show links: Armin Ronacher’s Thoughts and Writings Sentry Flask: A lightweight WSGI web application framework The Flask Mega-Tutorial: Miguel Grinberg ItsDangerous:It’s dangerous, so better sign this Pocoo Jinja2: Full-featured template engine for Python Werkzeug: Comprehensive WSGI web application library Click: Creating beautiful command line interfaces in a composable way The Pallets Projects: A collection of Python web development libraries Euro-pallet: Wikipedia article Pygments: Python syntax highlighter Sphinx: Python Documentation Generator Python Type Checking: Real Python Guide Typescript: JavaScript that scales mypy: Optional static type checker for Python Rust: A language empowering everyone to build reliable and efficient software Web Assembly: A binary instruction format for a stack-based virtual machine Level up your Python skills with our expert-led courses: Grow Your Python Portfolio With 13 Intermediate Project Ideas Documenting Code in Python Structuring a Python Application Support the podcast & join our community of Pythonistas
undefined
Jul 10, 2020 • 50min

Linear Programming, PySimpleGUI, and More

Are you familiar with linear programming, and how it can be used to solve resource optimization problems? Would you like to free your Python code from a clunky command line and start making convenient graphical interfaces for your users? This week on the show, David Amos is back with another batch of PyCoder’s Weekly articles and projects. David talks about a recent Real Python article about linear programming in Python. We discuss an article titled “PySimpleGUI: The Simple Way to Create a GUI With Python.” We also cover several other articles and projects from the Python community including: Python’s reduce() function, flaws in the pickle module, advanced pytest techniques, and how to trick a neural network. Course Spotlight: Parallel Iteration With Python’s zip() Function This course will get you up to speed with Python’s zip() function. In this course, you’ll discover the logic behind zip() and how you can use it to consistently solve common programming problems, like creating dictionaries. Topics: 00:00:00 – Introduction 00:01:34 – Python’s reduce(): From Functional to Pythonic Style 00:07:46 – Hands-On Linear Programming: Optimization With Python 00:15:07 – Pickle’s Nine Flaws 00:22:31 – Video Course Spotlight 00:23:33 – Advanced pytest Techniques I Learned While Contributing to pandas 00:33:41 – PySimpleGUI: The Simple Way to Create a GUI With Python 00:38:20 – How to Trick a Neural Network in Python 3 00:43:31 – TextAttack: A Python Framework for Adversarial Attacks, Data Augmentation, and Model Training in NLP 00:46:09 – byob: BYOB (Build Your Own Botnet) 00:49:09 – Thanks and Goodbye Show Links: Python’s reduce(): From Functional to Pythonic Style – In this step-by-step tutorial, you’ll learn how Python’s reduce() works and how to use it effectively in your programs. You’ll also learn some more modern, efficient, and Pythonic ways to gently replace reduce() in your programs. Hands-On Linear Programming: Optimization With Python – In this tutorial, you’ll learn about implementing optimization in Python with linear programming libraries. Linear programming is one of the fundamental mathematical optimization techniques. You’ll use SciPy and PuLP to solve linear programming problems. Pickle’s Nine Flaws – “Python’s pickle module is a very convenient way to serialize and de-serialize objects. It needs no schema, and can handle arbitrary Python objects. But it has problems. This post briefly explains the problems.” Advanced pytest Techniques I Learned While Contributing to pandas – Contributing to open-source projects is a great way to learn new techniques and level up your skills. Martin Winkel shares five advanced pytest techniques he learned while contributing to the pandas project. PySimpleGUI: The Simple Way to Create a GUI With Python – In this step-by-step tutorial, you’ll learn how to create a cross-platform graphical user interface (GUI) using Python and PySimpleGUI. A graphical user interface is an application that has buttons, windows, and lots of other elements that the user can use to interact with your application. How to Trick a Neural Network in Python 3 – Is that a corgi or a goldfish? Projects: TextAttack: A Python Framework for Adversarial Attacks, Data Augmentation, and Model Training in NLP byob: Build Your Own Botnet Additional Links: PyCoder’s Weekly Functional Programming in Python Linear Programming: Wikipedia article The Python pickle Module: How to Persist Objects in Python Marshmallow Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 2 Effective Python Testing With Pytest Getting Started With Testing in Python Practical Text Classification With Python and Keras PySimpleGUI Level up your Python skills with our expert-led courses: Supercharge Your Classes With Python super() Functional Programming in Python Parallel Iteration With Python's zip() Function Support the podcast & join our community of Pythonistas
undefined
Jul 3, 2020 • 1h 2min

Thinking in Pandas: Python Data Analysis the Right Way

Are you using the Python library Pandas the right way? Do you wonder about getting better performance, or how to optimize your data for analysis? What does normalization mean? This week on the show we have Hannah Stepanek to discuss her new book “Thinking in Pandas”. The inspiration behind Hannah’s book came out of her talk at PyCon US 2019 titled “Thinking Like a Panda: Everything You Need to Know to Use Pandas the Right Way.” We discuss several core concepts covered in the book. She shares techniques for getting more performance when working with your data in Pandas. We also talk about her recent PyCon US 2020 online presentation about databases and migration. Course Spotlight: Finding the Perfect Python Code Editor Find your perfect Python development setup with this review of Python IDEs and code editors. With this course you’ll get an overview of the most common Python coding environments to help you make an informed decision. Topics: 00:00:00 – Introduction 00:01:36 – Working for New Relic 00:03:14 – Thinking in Pandas book release 00:03:27 – Who is the intended reader? 00:05:27 – What is the underlying tech for Pandas? 00:09:04 – Why you shouldn’t use apply? 00:13:00 – When you have to use apply 00:16:06 – Normalizing your data 00:17:05 – Do you have a preferred format for a dataframe? 00:18:17 – More on multi-index dataframes 00:24:50 – Creating NumPy types 00:28:30 – Loading in your data 00:30:33 – Video Course Spotlight 00:31:41 – Pivoting data 00:34:34 – Considering outside libraries and performance 00:35:41 – What topic were you eager to share in the book? 00:37:52 – What resources did you use to learn pandas? 00:40:53 – PyCon 2020 talk about databases and migration 00:45:34 – Delving into migration and Alembic 00:53:15 – Speaking opportunities 00:56:13 – What are you excited about in the world of Python? 00:57:32 – What do you want to learn next? 00:58:49 – Do you read source code to learn? 01:00:16 – Is there a particularly well-written library? 01:01:28 – Final Thanks Links: Thinking in Pandas: How to Use the Python Data Analysis Library the Right Way - Apress Thinking like a Panda: Everything you need to know to use pandas the right way - PyCon 2019 - Hannah Stepanek pandas CPython Internals: Your Guide to the Python 3 Interpreter MultiIndex / advanced indexing: pandas documentation NumPy Data type objects (dtype) pandas.DataFrame.pivot: pandas documentation Let’s talk Databases in Python: SQLAlchemy and Alembic - PyCon 2020 - Hannah Stepanek SQLAlchemy: The Python SQL Toolkit and Object Relational Mapper Alembic: A database migration tool for SQLAlchemy import asyncio: Learn Python’s AsyncIO #1 - The Async Ecosystem Level up your Python skills with our expert-led courses: Finding the Perfect Python Code Editor Histogram Plotting in Python: NumPy, Matplotlib, Pandas & Seaborn Idiomatic pandas: Tricks & Features You May Not Know Support the podcast & join our community of Pythonistas
undefined
Jun 26, 2020 • 45min

Python Regular Expressions, Views vs Copies in Pandas, and More

This podcast covers a range of interesting topics including regular expressions in Python, views vs copies in Pandas, and methods for flattening a list in Python. They also discuss combining Flask and Vue, machine learning production, space science with Python, and a video course on reading and writing files in Python.
undefined
Jun 19, 2020 • 55min

Going Serverless with Python

Learn about the advantages of serverless computing with Python in the cloud and how it is suitable for data science, machine learning, and API creation. Discover how to use Azure Functions and VS Code for serverless development. Explore topics such as blob storage integration, working with service principles, and setting up and running serverless functions locally. The podcast also discusses real-time functionality with Flask Socket.IO and delves into the fascination with threading in Python.
undefined
Jun 12, 2020 • 45min

PDFs in Python and Projects on the Raspberry Pi

Have you wanted to work with PDF files in Python? Maybe you want to extract text, merge and concatenate files, or even create PDFs from scratch. Are you interested in building hardware projects using a Raspberry Pi? This week on the show we have David Amos from the Real Python team to discuss his recent article on working with PDFs. David also brings a few other articles from the wider Python community for us to discuss. David searches for the latest Python news, links, and articles to produce PyCoder’s Weekly with Dan Bader. PyCoder’s Weekly is a free email newsletter for those interested in Python development. Along with David’s article on PDFs, we discuss another recent Real Python article about building physical projects with the Raspberry Pi. We also discuss articles from the community about: the PEPs of Python 3.9, why you should stop using datetime.now, Python dependency tools, and several ways to pass code to Python from the terminal. Course Spotlight: Cool New Features in Python 3.8 This course will get you up to speed with the new features of the latest release of Python. You’ll learn about using assignment expressions, how to enforce postional-only arguments, more precise type hints, and using f-strings for simpler debugging. It’s a worthy investment of your time to understand what the most recent release of Python provides before moving on to the next version this fall. Topics: 00:00:00 – Introduction 00:02:06 – Ways to Pass Code to Python From the Terminal 00:05:54 – The PEPs of Python 3.9 00:10:54 – Creating and Modifying PDF Files in Python 00:18:51 – Video Course Spotlight 00:19:56 – An Overview of Python Dependency Tools 00:26:55 – Stop Using datetime.now 00:31:44 – Build Physical Projects With Python on the Raspberry Pi 00:38:18 – What are you excited about in the world of Python? 00:42:29 – What do you want to learn next in Python? 00:44:31 – Thanks and Good Bye Topic Links: PyCoder’s Weekly The Many Ways to Pass Code to Python From the Terminal – You might know about pointing Python to a file path, or using -m to execute a module. But did you know that Python can execute a directory? Or a .zip file? The PEPs of Python 3.9 – The first Python 3.9 beta release is upon us! Learn what to expect in the final October release by taking a tour of the Python Enhancement Proposals (PEPs) that were accepted for Python 3.9. Creating and Modifying PDF Files in Python – Explore the different ways of creating and modifying PDF files in Python. You’ll learn how to read and extract text, merge and concatenate files, crop and rotate pages, encrypt and decrypt files, and even create PDFs from scratch. Overview of Python Dependency Management Tools – While pip is often considered the de facto Python package manager, the dependency management ecosystem has really grown over that last few years. Learn about the different tools available and how they fit into this ecosystem. Stop Using datetime.now! (With Dependency Injection) – How do you test a function that relies on datetime.now() or date.today()? You could use libraries like FreezeGun or libfaketime, but not every project can afford the luxury of reaching for third-party solutions. Learn how dependency injection can help you write code that is more testable, maintainable, and practical. Build Physical Projects With Python on the Raspberry Pi – In this tutorial, you’ll learn to use Python on the Raspberry Pi. The Raspberry Pi is one of the leading physical computing boards on the market and a great way to get started using Python to interact with the physical world. Additional Links: Python Basics: A Practical Introduction to Python 3 PEG Parsers -Guido van Rossum - Medium article Code with Mu: a simple Python editor for beginner programmers SSH (Secure Shell) Visual Studio Code VSCode - Remote Development using SSH VIM and Python – A Match Made in Heaven - Real Python article How to Build a Python GUI Application With wxPython - Real Python article import asyncio: Learn Python’s AsyncIO #1 - The Async Ecosystem python-rtmidi - A Python binding for the RtMidi C++ library Level up your Python skills with our expert-led courses: Arduino With Python: Getting Started Finding the Perfect Python Code Editor Cool New Features in Python 3.8 Support the podcast & join our community of Pythonistas
undefined
5 snips
Jun 5, 2020 • 50min

Web Scraping in Python: Tools, Techniques, and Legality

Do you want to get started with web scraping using Python? Are you concerned about the potential legal implications? What are the tools required and what are some of the best practices? This week on the show we have Kimberly Fessel to discuss her excellent tutorial created for PyCon 2020 online titled “It’s Officially Legal so Let’s Scrape the Web.” We discuss getting started with web scraping, and cover tools and techniques. Kimberly gives advice on finding elements inside of the html, and techniques for cleaning your data. She also notes a recent change to the legal landscape regarding scraping the web. Kimberly is a Senior Data Scientist at Metis Data Science Bootcamp in New York City. She holds a Ph.D. in applied mathematics. We talk about her switch from academia to data science, and discuss her passion for data storytelling and visualizations. Course Spotlight: Defining Main Functions in Python This course will get you up to speed with defining a starting point for the execution of a program, and helps you to understand what goes into the main() function. Prepare for a deep dive as you go through the sections. It’s a worthy investment of your time to understand this vital entry point for your Python scripts and applications! Topics: 00:00:00 – Introduction 00:01:31 – Kimberly’s background and Metis Data Science Bootcamp 00:02:19 – NLP and work in advertising 00:03:27 – Changes in the legality of web scraping 00:06:12 – What are good projects for web scraping? 00:06:56 – Tools to start web scraping 00:07:51 – How to find the elements you want? 00:09:00 – How much HTML should you know? 00:10:49 – Inspecting elements in the browser 00:14:30 – What are good sites to practice on? 00:16:20 – Pausing between requests 00:19:02 – Saving as you go 00:20:54 – Real Python Video Course Spotlight 00:21:55 – Navigating the DOM 00:23:10 – Data cleaning and formatting 00:28:26 – Dynamic sites and Selenium 00:32:16 – Scrapy 00:33:55 – PyOhio 2020 00:35:40 – Transition out of academia 00:38:40 – What are you excited about in the world of Python? 00:41:05 – What do you want to learn next in Python? 00:48:00 – What is a less known Python tip or trick? 00:49:17 – Thanks and Goodbye Show Links: Kimberly Fessel, PHD - Blog Metis: Data Science Training It’s Officially Legal so Let’s Scrape the Web: PyCon 2020 online - Tutorial Victory! Ruling in hiQ v. Linkedin Protects Scraping of Public Data: EFF.org Computer Fraud and Abuse Act - Wikipedia Article Box Office Mojo Sports Reference | Sports Stats, fast, easy, and up-to-date Springfield! Springfield! - TV & Movie Scripts - Archive.org Jupyter Notebook: An Introduction - Real Python Article The Python pickle Module: How to Persist Objects in Python - Real Python Article A Practical Introduction to Web Scraping in Python - Real Python Article Beautiful Soup: Build a Web Scraper With Python - Real Python Article Making HTTP Requests With Python - Real Python Video Course Natural Language Processing With spaCy in Python - Real Python Article Delorean: Time Travel Made Easy Maya: Datetimes for Humans Regular Expressions: Regexes in Python (Part 1) - Real Python Article Selenium: Automates browsers. That’s it! Scrapy: Framework for extracting the data you need from websites PyOhio 2020 ODSC: Open Data Science Conference Slides from Kimberly’s talk - Level Up: Fancy NLP with Straightforward Tools Tonks: A general purpose deep learning library Tonks: Building One (Multi-Task) Model to Rule Them All! - Medium Article Plotly | Dash geoplotlib: Python toolbox for visualizing geographical data and making map GeoPandas: Make working with geospatial data in Python easier Altair: Declarative Visualization in Python Understanding the Transform Function in Pandas: Practical Business Python JavaScript charting detour: Down and Up: A Puzzle Illustrated with D3.js - Kimberly’s blog d3js - Data-Driven Documents Crossfilter: Fast Multidimensional Filtering for Coordinated Views dc.js - Dimensional Charting JavaScript Library Level up your Python skills with our expert-led courses: Defining Main Functions in Python Making HTTP Requests With Python Strings and Character Data in Python Support the podcast & join our community of Pythonistas

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app