The Real Python Podcast

Real Python
undefined
Apr 22, 2022 • 59min

Type-Safe ORM With Prisma Client & Real Python at PyCon US 2022

Are you using an Object-Relational Mapper (ORM) for your Python projects? What if it could work with SQL or No-SQL databases and be fully type-safe? This week on the show, Robert Craigie talks about Prisma Client Python. Prisma Client Python is built on top of Prisma, which was created for TypeScript and Node.js. It uses a schema file to declare your application’s data models and relationships in a human-readable form. The schema file allows you to easily switch the database type. Prisma Client is different from other Python ORMs. It is fully type-safe and can be used with or without async. We talk about how Robert started the project and what types of challenges he’s faced. He also shares areas of improvement and how to contribute to the project. We also have a conversation with several Real Python core team members about PyCon US 2022. We will have a booth at the conference where we hope you’ll come and connect with us. The team also shares what to expect from PyCon and what they’re excited about this year. Course Spotlight: Python REST APIs With FastAPI In this course, you’ll learn the main concepts of FastAPI and how to use it to quickly create web APIs that implement best practices by default. By the end of it, you will be able to start creating production-ready web APIs. Topics: 00:00:00 – Introduction 00:02:15 – Have you worked on other open-source projects? 00:02:59 – What is Prisma? 00:05:00 – What are advantages of using an ORM? 00:06:52 – What problem is Prisma Client solving? 00:08:43 – What was involved in porting the project over? 00:09:55 – Creating a Prisma schema 00:12:09 – Other challenges along the way 00:14:57 – Dangers of not having type safety 00:16:27 – Sponsor: Linear B 00:17:06 – How long have you been working on the project? 00:18:57 – How could someone contribute to the project? 00:21:03 – In what situations does Prisma Client excel? 00:24:21 – What other projects do you currently work on? 00:24:57 – What are you excited about in the world of Python? 00:28:01 – What do you want to learn next? 00:29:52 – Thanks and Goodbye 00:30:14 – Introduction of RP team 00:31:09 – What are we doing at PyCon 2022? 00:35:55 – How to Get the Most Out of PyCon US 00:37:42 – Tutorials at PyCon US 2022 00:40:24 – Video Course Spotlight 00:41:49 – Talks at PyCon US 2022 00:50:16 – Sprints at PyCon US 2022 00:54:38 – Final thoughts 00:57:30 – Thanks and goodbyes Show Links: Prisma Client Python Prisma schema (Reference) | Prisma Docs TypeScript: JavaScript With Syntax For Types. pyright: Static type checker for Python pyright-python: Python command line wrapper for pyright, a static type checker Pylance - Visual Studio Marketplace MkDocs Rust Programming Language prisma-client-py: An auto-generated and fully type-safe database client built for autocomplete Prisma Python Discord server PyCon 2022 Welcome to PyCon US 2022 How to Get the Most Out of PyCon US – Real Python KiwiPyCon - New Zealand Python User Group EuroSciPy PyColorado 2019 Level up your Python skills with our expert-led courses: Python REST APIs With FastAPI Building a Django User Management System Exploring Basic Data Types in Python Support the podcast & join our community of Pythonistas
undefined
Apr 15, 2022 • 58min

Class Constructors & Pythonic Image Processing

Do you know the difference between creating a class instance and initializing it? Would you like an interactive tour of the Python Pillow library? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects. We talk about the recent Real Python tutorial “Image Processing With the Python Pillow Library.” It walks you through manipulating, filtering, and creating images from scratch. Christopher shares an article about Python class constructors, exploring the two-step instance creation and initialization process. We also have a couple of discussions this week. The first is about contributing to open source projects. The second topic is about searching large codebases before adding features. We cover several other articles and projects from the Python community, including the counter-intuitive rise of Python in scientific computing, preparation for interview questions, a project for adding pointer hell to Python, and a fast and powerful graphical user interface tool kit for Python with minimal dependencies. Spotlight: Python vs JavaScript for Python Developers Python and JavaScript are two of the most popular programming languages in the world. In this course, you’ll take a deep dive into the JavaScript ecosystem by comparing Python vs JavaScript. You’ll learn the jargon, language history, and best practices from a Python developer’s perspective. Topics: 00:00:00 – Introduction 00:02:18 – Image Processing With the Python Pillow Library 00:11:10 – The Counter-Intuitive Rise of Python in Scientific computing 00:17:15 – 20 Python Interview Questions 00:25:48 – Sponsor: FusionAuth 00:26:25 – Python Class Constructors: Control Your Object Instantiation 00:31:17 – Do You Contribute to Open Source Projects? 00:42:43 – Video Course Spotlight 00:44:08 – How To Search Large Codebases Before Adding a Feature? 00:49:34 – pointers.py: Bringing the Hell of Pointers to Python 00:52:16 – DearPyGui: A fast and powerful Graphical User Interface Toolkit for Python 00:57:11 – Thanks and goodbye Topic Links: Image Processing With the Python Pillow Library – Learn how to use the Python Pillow library to deal with images. Combine this with some NumPy to process images and create animations. The Counter-Intuitive Rise of Python in Scientific computing – Explore why Python’s ability to write code quickly and access more libraries can outperform heavily optimized compiled code. 20 Python Interview Questions – Practice up for that next interview. Questions about data structures, language concepts, and some common standard library functions. Python Class Constructors: Control Your Object Instantiation – Learn how class constructors work in Python and explore the two steps of Python’s instantiation process: instance creation and instance initialization. Discussion: Do You Contribute to Open Source Projects? How To Search Large Codebases Before Adding a Feature? Projects: pointers.py: Bringing the Hell of Pointers to Python hoffstadt/DearPyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies Additional Links: Gonzalez & Woods, Digital Image Processing, 4th Edition | Pearson Pillow: Image Processing with Python Python Pillow danielgatis/rembg: Rembg is a tool to remove images background. Top 50 Python Interview Questions for Data Science | AnalytixLabs Programming FAQ — Python 3.10.4 documentation Episode #49: The Challenges of Developing Into a Python Professional – The Real Python Podcast PyCoder’s Weekly | Submit a Link awesome-python: Awesome Python Libraries and Resources Dear PyGui’s Documentation — Dear PyGui documentation ocornut/imgui: Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies Video Tutorials — Dear PyGui documentation Level up your Python skills with our expert-led courses: Python vs JavaScript for Python Developers Simplify Python GUI Development With PySimpleGUI Documenting Python Projects With Sphinx and Read The Docs - Archived Support the podcast & join our community of Pythonistas
undefined
Apr 8, 2022 • 1h 22min

Creating Better Error Messages for Python 3.10 & 3.11

What goes into creating those enhanced error messages in the latest versions of Python? How does the new PEG parser help to pinpoint where errors have occurred? This week on the show, Pablo Galindo Salgado talks about the work that goes into creating these improvements. Pablo is a core CPython developer and is the release manager for Python versions 3.10 and 3.11. He is also serving his second term on the Python Steering Council. Pablo is pleasantly surprised by the positive feedback for the new error messages in Python 3.10. He shares some of the upcoming enhancements for 3.11. We talk about how the new PEG parser allows for greater context when defining errors and pinpointing where they occur. We talk about how he started contributing to CPython. He also shares some of the programming experiences he had while studying physics at university. Course Spotlight: Starting With Linear Regression in Python In this video course, you’ll get started with linear regression in Python. Linear regression is one of the fundamental statistical and machine learning techniques, and Python is a popular choice for machine learning. Topics: 00:00:00 – Introduction 00:01:56 – Member of the Python Steering Council 00:02:40 – Physics background and research use of Python 00:08:43 – How did you get involved in core development? 00:10:27 – Why did you take on the role of release manager? 00:13:38 – What challenges have you found along the way? 00:19:08 – Sponsor: LinearB 00:19:48 – What motivated you to add enhanced error messages? 00:29:33 – How does the PEG parser help in these situations? 00:37:04 – PEG parser and infinite lookahead 00:40:58 – Identifying where the syntax is wrong 00:43:28 – Finding where a comma is missing 00:48:49 – Is this a dictionary missing a colon, or is it a set? 00:50:19 – Identifying missing portions of a try … except block 00:51:44 – Video Course Spotlight 00:53:00 – Informing library maintainers and not slowing performance 00:56:18 – Enhanced error messages coming in 3.11 01:06:38 – Real Python preview of Python 3.11 01:07:28 – What are you excited about in the world of Python? 01:13:00 – What do you want to learn next? 01:15:43 – How to contribute to the project? 01:20:24 – Thanks and goodbye Show Links: PEP 8016 – The Steering Council Model | peps.python.org Fortran Programming Language Wolfram Mathematica: Modern Technical Computing C (programming language) - Wikipedia Mare Nostrum, The Temple Of The Bit | WIRED Python Insider: Python 3.10.4 and 3.9.12 are now available out of schedule PEP 657 – Include Fine Grained Error Locations in Tracebacks | peps.python.org Python 3.11 Preview: Even Better Error Messages – Real Python friendly-traceback: Friendlier Python tracebacks. IPython - Interactive Computing Coverage.py - Documentation faster-cpython/ideas - presentation pdf · GitHub PEP 659 – Specializing Adaptive Interpreter | peps.python.org How to Sweep Pick: 14 Steps (with Pictures) - wikiHow Line 6 - Shuriken Variax Guitar Talks: Making Python Better One Error Message at a Time PyCon 2022 Python Developer’s Guide Guide to CPython’s Parser - Python Developer’s Guide pablogsal (Pablo Galindo Salgado) · GitHub Pablo Galindo Salgado (@pyblogsal) / Twitter Level up your Python skills with our expert-led courses: Cool New Features in Python 3.10 Starting With Linear Regression in Python Raising and Handling Python Exceptions Support the podcast & join our community of Pythonistas
undefined
Apr 1, 2022 • 53min

Building a Hash Table in Python and Thoughtful REST API Design

Do you understand how a hash table works? What if you could learn about building one while practicing test-driven development? What are best practices when designing a REST API? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects. We talk about the recent Real Python article “Build a Hash Table in Python With TDD.” The tutorial shows how to implement a hash table prototype from scratch in Python. It also provides a hands-on crash course in test-driven development. Christopher shares an article on designing REST APIs and provides some of his own best practices. We cover authentication implementation, good naming conventions, versioned APIs, and ways to specify dates. We cover several other articles and projects from the Python community, including a news roundup, a PEP on removing dead batteries from the standard library, a comparison of the Python list vs tuple, a guide to writing user-friendly CLIs in Python, just enough Cython to be useful, a cross-platform TUI and ASCII animation package, and code for running black on Python code blocks in documentation files. Course Spotlight: Command Line Interfaces in Python Command-line arguments are the key to converting your programs into useful and enticing tools that are ready to be used in the terminal of your operating system. In this course, you’ll learn their origins, standards, and basics, and how to implement them in your program. Topics: 00:00:00 – Introduction 00:02:23 – PEP 594: Removing Dead Batteries From the Standard Library 00:05:33 – Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 Now Available 00:08:37 – EuroPython 2022: Ticket Sales Open 00:09:34 – Python list vs tuple Comparison 00:12:19 – How to Write User-Friendly CLIs in Python 00:20:14 – Sponsor: Anvil 00:20:55 – Build a Hash Table in Python With TDD 00:26:11 – Just Enough Cython to Be Useful 00:36:21 – Video Course Spotlight 00:37:45 – How to Design Better REST APIs 00:47:10 – blacken-docs: Run black on Python Code Blocks within Documentation Files 00:49:09 – asciimatics: Cross Platform TUI and ASCII Animation Package 00:52:03 – Thanks and goodbye News: PEP 594: Removing Dead Batteries From the Standard Library Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 Now Available EuroPython 2022: Ticket Sales Open Topic Links: Python list vs tuple Comparison – Learn how list and tuple are similar and how they’re different, including storage and speed differences and how to choose between them. How to Write User-Friendly CLIs in Python – Learn how to write user-friendly command-line interface applications and an overview of several of the popular CLI libraries: argparse, Click, Typer, Docopt, and Fire. Build a Hash Table in Python With TDD – In this step-by-step tutorial, you’ll implement the classic hash table data structure using Python. Along the way, you’ll learn how to cope with various challenges such as hash code collisions while practicing test-driven development (TDD). Just Enough Cython to Be Useful – Cython is a superset of Python designed to give C-like performance. Ever wanted to learn the basics? This article shows you how to get started. How to Design Better REST APIs – Fifteen language-agnostic tips on REST API design, including good naming conventions, ways to specify dates, versioned APIs, authentication keys, pagination, and when to use which HTTP methods. Projects: blacken-docs: Run black on Python Code Blocks in Documentation Files asciimatics: Cross Platform TUI and ASCII Animation Package Additional Links: Command Line Interface Guidelines - An Open-Source Guide How to Build Command Line Interfaces in Python With argparse – Real Python Command Line Interfaces in Python – Real Python Language Basics — Cython 3.0.0a10 documentation Building HTTP APIs With Django REST Framework – Real Python Python Timer Functions: Three Ways to Monitor Your Code – Real Python Level up your Python skills with our expert-led courses: Lists and Tuples in Python Command Line Interfaces in Python Rock, Paper, Scissors With Python: A Command Line Game Support the podcast & join our community of Pythonistas
undefined
Mar 25, 2022 • 60min

Becoming More Effective at Manipulating Data With Pandas

Do you wonder if you’re taking the right approach when shaping data in pandas? Is your Jupyter workflow getting out of hand? This week on the show, Matt Harrison talks about his new book, “Effective Pandas: Patterns for Data Manipulation.” Matt discusses working as a corporate consultant and migrating Excel users toward Python. We explore several “NumPy-isms” that beginners get stuck on. Matt shares advice about chaining operations in pandas, which some developers find controversial. Course Spotlight: Sorting Data in Python With Pandas In this video course, you’ll learn how to sort data in a pandas DataFrame using the pandas sort functions sort_values() and sort_index(). You’ll learn how to sort by one or more columns and by index in ascending or descending order. Topics: 00:00:00 – Introduction 00:01:32 – Working as a consultant 00:03:39 – Moving from Excel to Python 00:06:50 – Who is the book for? 00:10:15 – Using real data for examples 00:16:16 – Sponsor: CData Software 00:16:58 – What are patterns for data manipulation? 00:18:38 – Cleaning and preparing data 00:21:33 – What concepts were you most eager to share? 00:26:57 – An example of chaining operations in pandas 00:33:20 – NumPy-isms and other challenges in learning pandas 00:40:20 – The use of exercises throughout the book 00:43:50 – Video Course Spotlight 00:45:01 – Challenges of using color throughout the book 00:51:40 – Avoiding the slow path in pandas 00:56:03 – What are you excited about in the world of Python? 00:56:58 – What would you like to learn next? 00:58:16 – Effective Pandas book 00:58:38 – Social connections 00:58:58 – Thanks and goodbye Show Links: Effective Pandas Digital Book Discount Link Matt Harrison’s Site - MetaSnake pandas - Python Data Analysis Library Law of Demeter - Wikipedia PyCon 2022 - Welcome to PyCon US Production-ready Docker packaging for Python developers | Python=>Speed Level up your Python skills with our expert-led courses: Using pandas to Make a Gradebook in Python The pandas DataFrame: Working With Data Efficiently Sorting Data in Python With pandas Support the podcast & join our community of Pythonistas
undefined
Mar 18, 2022 • 47min

Making Your Notebook Interactive and Using Python's Assert

Would you like to build visualizations that allow your audience to play with data? How do you effectively use Python’s assert statement during development? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects. We talk about an article that shows how to build interactive visualizations with pandas, seaborn, and ipywidgets. These widgets allow you to add sliders, buttons, and dropdown menus to your Jupyter Notebooks. Christopher shares the Real Python article “Python’s assert: Debug and Test Your Code Like a Pro”. It covers how to use assert statements to document, debug, and test code while in development. We cover several other articles and projects from the Python community, including a news roundup, code review guidelines for data science teams, a project to manage your to-do lists using Python and Django, a Python 4 dream list, a static site generator based on Django, and a book of practical Python projects. Course Spotlight: Building a Neural Network & Making Predictions With Python AI In this step-by-step course, you’ll build a neural network from scratch as an introduction to the world of artificial intelligence (AI) in Python. You’ll learn how to train your neural network and make predictions based on a given dataset. Topics: 00:00:00 – Introduction 00:02:12 – Tomli TOML Parser Will Be in Python 3.11 Standard Library 00:03:53 – Python Core Moving Bug Tracking to Github 00:05:54 – Python Release: Python 3.11.0a6 00:06:09 – PEPs have a new home with a shiny, new theme! 00:07:03 – Python’s assert: Debug and Test Your Code Like a Pro 00:10:35 – Sponsor: FusionAuth 00:11:12 – Interactive Visualizations with Pandas, Seaborn and Ipywidgets 00:16:06 – Code Review Guidelines for Data Science Teams 00:19:22 – Manage Your To-Do Lists Using Python and Django 00:23:56 – Video Course Spotlight 00:24:56 – Your Python 4 Dream List 00:34:37 – django-distill | Static Site Generator Based on Django 00:38:40 – Practical Python Projects Book 00:46:02 – Thanks and Goodbye News: Tomli TOML Parser Will Be in Python 3.11 Standard Library Python Core Moving Bug Tracking to Github Python Release: Python 3.11.0a6 | Python.org “PEPs have a new home with a shiny, new theme!” | Brett Cannon on Twitter Topic Links: Python’s assert: Debug and Test Your Code Like a Pro – Learn how to use Python’s assert statement to document, debug, and test code in development. Interactive Visualizations with Pandas, Seaborn and Ipywidgets – Create interactive visual output using ipywidgets. Code Review Guidelines for Data Science Teams – Although written for data science teams, a good article on why any team of coders should do code reviews. How to do them, what to look for, and how to improve your code. Manage Your To-Do Lists Using Python and Django – Use Django to build a to-do list manager app. This step-by-step tutorial will teach you how to use Django’s class-based views to build a powerful app while dramatically reducing your development time. Your Python 4 Dream List – “If there was to ever be Python 4 (not a minor version increment, but full fledged new Python), what would you like to see in it?” Projects: django-distill | Static Site Generator Based on Django Practical Python Projects Book Additional Links: What the heck is pyproject.toml? Episode #82: Welcoming the CPython Developer in Residence | The Real Python Podcast PEP 0 – Index of Python Enhancement Proposals (PEPs) | peps.python.org seaborn: statistical data visualization | seaborn 0.11.2 documentation Cameras and Lenses | Bartosz Ciechanowski weasyprint | PyPI Level up your Python skills with our expert-led courses: Building a Neural Network & Making Predictions With Python AI Using Jupyter Notebooks Plot With pandas: Python Data Visualization Basics Support the podcast & join our community of Pythonistas
undefined
5 snips
Mar 11, 2022 • 1h 3min

Tools for Setting Up Python on a New Machine

There are many ways to get Python installed on your computer. If you were going to start fresh, what tools would you use? What if you need to manage multiple versions of Python and virtual environments? What about all the additional tools that make your coding workflow complete? This week on the show, Calvin Hendryx-Parker is here to talk about bootstrapping your Python environment. Calvin is the co-founder and CTO of Six Feet Up and a Python Web Conference co-organizer. As a consultant, Calvin has set up countless machines to run Python. He configures environments that can scale from in-office projects to distributed cloud-based applications. We cover tools for installing Python, managing multiple language versions, and configuring virtual environments. Calvin talks about setting up command-line applications in isolated environments. We also discuss traveling with Python on an iPad. Course Spotlight: Start Managing Multiple Python Versions With pyenv In this step-by-step course, you’ll learn how to install multiple Python versions and switch between them, including project-specific virtual environments, with ease with pyenv. Topics: 00:00:00 – Introduction 00:02:42 – Giving talks at IndyPy 00:03:12 – Calvin’s talk “Half a Dozen Ways to Fail at Python” 00:07:41 – Advice on installing Python using Homebrew and pyenv 00:11:48 – The consistency of using a Docker container 00:18:49 – Creating virtual environments and installing packages 00:21:51 – Sponsor: ScoutAPM 00:22:38 – Creating requirements.txt files and moving from pipenv to piptools 00:30:54 – Paying attention to security issues and your software supply chain 00:34:19 – The goal of making a repeatable developer build experience 00:39:30 – Video Course Spotlight 00:40:47 – Using pipx to set up CLI code tools 00:44:52 – Using bpytop to monitor performance 00:46:41 – Tools for using Python on the iPad 00:53:06 – Python Web Conference 00:56:08 – Moving your dotfiles across multiple machines with chezmoi 01:02:22 – Thanks and goodbye Show Links: Half a Dozen Ways to Fail at Python – YouTube calvinhp/2019 WaysToFailAtPython – GitHub Calvin Hendryx Parker - Bootstrapping your Local Python Environment – YouTube calvinhp/2021 BootstrappingYourLocalPythonEnvironment – GitHub Six Feet Up: Python web application development and cloud management services Homebrew: The Missing Package Manager for macOS (or Linux) Chocolatey - The package manager for Windows Python 3 Installation & Setup Guide – Real Python Your Python Coding Environment on Windows: Setup Guide - Real Python Managing Multiple Python Versions With pyenv – Real Python A quick-and-dirty guide on how to install packages for Python Why you should use “python -m pip” pypa/pipenv: Python Development Workflow for Humans. pip-tools · PyPI safety · PyPI Production-ready Docker packaging for Python developers pipx: Install and Run Python Applications in Isolated Environments bpytop: Resource monitor that shows usage and stats - PyPI Episode #272 The tools episode - Python Bytes Podcast Road Warrior Developer – YouTube 5 Ways To Use Python On An iPad Advanced Visual Studio Code for Python Developers – Real Python chezmoi: Manage your dotfiles across multiple diverse machines, securely Python Web Conference 2022 — Python Web Conf 2022 Level up your Python skills with our expert-led courses: A Beginner's Guide to pip Installing Python on Windows, macOS, and Linux Start Managing Multiple Python Versions With pyenv Support the podcast & join our community of Pythonistas
undefined
Mar 4, 2022 • 53min

Defining Optional Arguments and Moving Beyond "Beginner" Python

How do you define Python functions that accept optional arguments or default values? Are you wondering how to go beyond being a beginner with Python? This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects. Christopher shares a Real Python article, “Defining Python Functions With Optional Arguments.” We talk about function flexibility, specifying default values, and using args & kwargs. We discuss resources for a Python beginner to move beyond the basics and become more competent. Both of us share our experiences moving past these hurdles. We cover several other articles and projects from the Python community, including a news roundup, ten tools you may have wished you knew when you started working with Python, Python’s zipfile for manipulating your zip files efficiently, how one company optimized Python API server code by 100x, a dependency-free Python library for downloading YouTube videos, and how to use Python on the command line with other shell commands. Course Spotlight: Defining Python Functions With Optional Arguments In this video course, you’ll learn about Python optional arguments and how to define functions with default values. You’ll also learn how to create functions that accept any number of arguments using args and kwargs. Topics: 00:00:00 – Introduction 00:03:08 – Django Project Reformats Entire Codebase With Black 00:03:53 – PEP 673: Self Type Was Accepted 00:05:16 – PEP 654 Accepted: Exception Groups 00:07:45 – Upcoming Python Feature PEPs 00:10:01 – Defining Python Functions With Optional Arguments 00:15:12 – Sponsor: CData Software 00:15:53 – 10 Tools I Wish I Knew When I Started Working With Python 00:23:22 – How We Optimized Python API Server Code 100x 00:29:47 – Python’s zipfile: Manipulate Your ZIP Files Efficiently 00:32:47 – Video Course Spotlight 00:33:59 – How Do I Go From Being a Beginner to Competent in Python? 00:47:02 – pytube: Dependency-Free Python Library for Downloading – YouTube Videos 00:49:30 – pz: Use Python on the Command Line With Other Shell Commands 00:52:23 – Thanks and goodbye News: Django Project Reformats Entire Codebase With Black – Related discussion on Hacker News. PEP 673: Self Type Was Accepted – This PEP introduces a simple and intuitive way to annotate methods that return an instance of their class. This behaves the same as the TypeVar-based approach specified in PEP 484 but is more concise and easier to follow. Related Twitter thread by core dev Raymond Hettinger. PEP 654 Accepted: Exception Groups – New standard for grouping exceptions together Upcoming Python Feature PEPs – “These PEPs are a great way of getting the freshest info about what might be included in the upcoming Python releases. So, in this article we will go over all the proposals that are going to bring some exciting new Python features in a near future!” Topics: Defining Python Functions With Optional Arguments – Learn about Python optional arguments and how to define functions with default values. You’ll also see how to create functions that accept any number of arguments using *args and **kwargs. 10 Tools I Wish I Knew When I Started Working With Python – Learn about how venvs, flake8, black, isort, pytest, commitizen, semantic-release, pre-commit hooks, and Github Actions work together! How We Optimized Python API Server Code 100x – Tricks we used to speed up calls to our analytical API written in Python: asyncio, SQLAlchemy, asyncpg, Cython plugins, improved data structures, and replaced some Pandas with NumPy. Python’s zipfile: Manipulate Your ZIP Files Efficiently – In this guided tutorial, you’ll learn how to manipulate ZIP files using Python’s zipfile module from the standard library. Through hands-on examples, you’ll learn how to read, write, compress, and extract files from your ZIP files quickly. How Do I Go From Being a Beginner to Competent in Python? Projects: pytube: Dependency-Free Python Library for Downloading YouTube Videos pz: Use Python on the Command Line With Other Shell Commands Additional Links: Fluent Python, 2nd Edition Python Distilled Intermediate to Advanced resources - Python resources for everybody The Flask Mega-Tutorial Part I: Hello, World! Level up your Python skills with our expert-led courses: Defining Python Functions With Optional Arguments Defining and Calling Python Functions Writing Beautiful Pythonic Code With PEP 8 Support the podcast & join our community of Pythonistas
undefined
Feb 25, 2022 • 59min

OAuth 2 and Authentication Choices for Your Python Project

Have you thought about what authentication system you want to use for your Python project? Should you use an existing Python library or a third-party service? This week on the show, Dan Moore is here to talk about authentication systems and OAuth 2. Dan is the head of developer relations at FusionAuth. He shares advice about setting up an authentication system, setting up device grants, using social login, and addressing privacy issues. Dan also provides multiple resources to learn much more about the topic. Course Spotlight: Using Google Login With Flask In this course, you’ll create a Flask application that lets users sign in using their Google login. You’ll learn about OAuth 2 and OpenID Connect and also find out how to implement some code to handle user session management. Topics: 00:00:00 – Introduction 00:01:58 – What is FusionAuth? 00:03:13 – What is the single-responsibility principle? 00:04:14 – Thinking about setting up an authentication system 00:08:42 – Background on OAuth 00:13:26 – Device grants 00:19:23 – Using another provider’s login and addressing privacy issues 00:28:39 – Video Course Spotlight 00:29:53 – Resources to learn more about privacy and identity 00:32:39 – Setting up an OAuth system 00:35:59 – DIY authentication pitfalls and hashing passwords 00:42:57 – Staying on top of updates and social engineering 00:51:29 – Resources for learning more about OAuth 00:54:30 – What are you excited about in the world of Python? 00:55:42 – What do you want to learn next? 00:56:49 – Final words and social connections 00:57:47 – Thanks and goodbye Show Links: FusionAuth - Auth. Built for Devs, By Devs RFC 6749 - The OAuth 2.0 Authorization Framework RFC 6750 - The OAuth 2.0 Authorization Framework: Bearer Token Usage Single-responsibility principle - Wikipedia oauthlib · PyPI Final: OpenID Connect Core 1.0 International Association of Privacy Professionals IDPro: Identity Professionals Have I Been Pwned: Check if your email has been compromised in a data breach Hash Functions | National Institute of Standards and Technology (NIST) - Computer Security Resource Center (CSRC) Guides Overview - FusionAuth The Modern Guide to OAuth - FusionAuth Solving Identity Management in Modern Applications | SpringerLink OAuth 2 in Action Getting started — Django OAuth Toolkit 1.7.0 documentation Flask-Login — Flask-Login 0.4.1 documentation Adding social sign in to your Django web application using OAuth - FusionAuth Create a Flask Application With Google Login – Real Python Draft IETF - OAuth V2.1.04 Level up your Python skills with our expert-led courses: Django View Authorization: Restricting Access Using Google Login With Flask Deploy Your Python Script on the Web With Flask Support the podcast & join our community of Pythonistas
undefined
Feb 18, 2022 • 51min

Drawing Fractals With Python and Working With a Weather API

Have you been wanting to explore fractals and complex numbers in Python? Would you like to practice working with APIs in Python through a new project? This week on the show, Christopher Trudeau is here, and he’s taking on the task of curating new issues of PyCoder’s Weekly going forward. He’ll be joining me as a cohost every other week and bringing a fresh batch of PyCoder’s Weekly articles and projects. We discuss a Real Python article about drawing the Mandelbrot set in Python. The tutorial guides you through creating fractal art using Matplotlib and Pillow. We also share a new step-by-step project building a weather-reporting command-line interface (CLI) app. We cover several other articles and projects from the Python community, including a news roundup, a better Pygame main loop, ways to work with static and media files in Django, and a library for pleasing console output. Course Spotlight: Make a 2D Side-Scroller Game With Pygame In this step-by-step course, you’ll learn how to use Pygame. This library allows you to create games and rich multimedia programs in Python. You’ll learn how to draw items on your screen, implement collision detection, handle user input, and much more! Topics: 00:00:00 – Introduction 00:02:15 – Black, the Python Code Formatter, Is Stable 00:04:07 – Apple Removes Python 2.7 in macOS Monterey 12.3 00:06:36 – GitHub Survey on Languages and More Developer Things 00:10:14 – CPython 3.11.0a5 Is Available 00:11:48 – Django Security Releases Issued: 4.0.2, 3.2.12, and 2.2.27 00:12:43 – A Better Pygame Main Loop 00:21:22 – Sponsor: CData Software 00:22:04 – Draw the Mandelbrot Set in Python 00:29:12 – The Fastest Way to Read a CSV in Pandas 00:35:16 – Video Course Spotlight 00:36:26 – Working With Static and Media Files in Django 00:41:42 – Raining Outside? Build a Weather CLI App With Python 00:48:15 – konsole: Readable, Pleasing Console Output 00:50:27 – Thanks and Goodbye News: Black, the Python Code Formatter, Is Stable – The popular Python autoformatter Black is finally non-beta software. Related discussion on Hacker News and Black’s stability policy doc. Apple Removes Python 2.7 in macOS Monterey 12.3 – “Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead.” Also see the related discussion on Hacker News. GitHub Survey on Languages and More Developer Things – JavaScript retains the top spot, Python keeps second place gained in 2019 over Java, which holds in third. TypeScript continues fourth after racing up tenth in 2017 to fourth in 2020. JavaScript + TypeScript seem to put that way ahead in terms of amount of code on GitHub. CPython 3.11.0a5 Is Available – “We needed to tame some angry buildbots, but after a small fight, we won with just some scratches! Here you have a shiny new alpha release: Python 3.11.0a5.” Django Security Releases Issued: 4.0.2, 3.2.12, and 2.2.27 – Includes fixes for a possible XSS via debug template tag and a denial-of-service possibility in file uploads. Articles: A Better Pygame Main Loop – Improving your game’s main loop for smoother gameplay that takes less battery power: “Now your players’ laptops run cool while playing, and the graphics don’t have ugly tearing artifacts any more!” Draw the Mandelbrot Set in Python – In this tutorial, you’ll visualize the famous Mandelbrot set using Python’s Matplotlib and Pillow libraries. You’ll learn how to draw the fractal in black and white, grayscale, and color. The Fastest Way to Read a CSV in Pandas – This article covers pandas’ default CSV reading, the faster and more parallel CSV reader introduced in v1.4, and a different approach that can make things even faster. Working With Static and Media Files in Django – A look at how to work with static and media files in a Django project, locally and in production. Projects: Raining Outside? Build a Weather CLI App With Python – In this tutorial, you’ll write a nicely formatted Python CLI app that displays information about the current weather in any city that you provide the name for. konsole: Readable, Pleasing Console Output Additional Links: Make a 2D Side-Scroller Game With Pygame – Real Python Using Pygame to Build an Asteroids Game in Python – Real Python Deciphering Glyph :: Nice Animations with Twisted and PyGame pygame 4000 book by pygame Where’s your bottleneck? CPU time vs wallclock time Storing Django Static and Media Files on Amazon S3 | TestDriven.io OpenWeatherMap API guide - OpenWeatherMap Level up your Python skills with our expert-led courses: Using Pygame to Build an Asteroids Game in Python Getting Started With Django: Building a Portfolio App Make a 2D Side-Scroller Game With PyGame 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