The Real Python Podcast

Real Python
undefined
May 27, 2022 • 52min

Questions for New Dependencies & Comparing Python Game Libraries

What are the differences between the various Python game frameworks? Would it help to see a couple of game examples across several libraries to understand the distinctions? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects. We discuss a Real Python article by previous guest Jon Fincher titled “Top Python Game Engines”. Jon compares five different game frameworks and provides example projects and thorough commentary for each. We talk about a blog post by recent guest Adam Johnson about determining if a project is well maintained. He suggests twelve questions to decide whether to add a new dependency to your project. We cover several other articles and projects from the Python community, including a news roundup, Python decorator patterns, finding the smallest and largest values with min() and max(), a discussion about the most-used Python packages, the pony object-relational mapper, and a project to read PEPs in your console. Course Spotlight: Using Pygame to Build an Asteroids Game in Python In this course, you’ll build a clone of the Asteroids game in Python using Pygame. Step by step, you’ll add images, input handling, game logic, sounds, and text to your program. Topics: 00:00:00 – Introduction 00:02:04 – News: Python Release Python 3.11.0b1 00:02:56 – Faster CPython project 00:04:16 – nogil conversation at the 2022 summit 00:06:08 – PEP 690: Lazy Imports 00:08:14 – DjangoCon US & Europe 2022 Call for Proposals 00:09:25 – Top Python Game Engines 00:20:38 – Sponsor: CData Software 00:21:20 – Python Decorator Patterns 00:24:00 – The Well-Maintained Test: 12 Questions for New Dependencies 00:29:27 – Python’s min() and max(): Find Smallest and Largest Values 00:33:33 – Video Course Spotlight 00:34:44 – Which Python Packages Do You Use the Most? 00:41:42 – pony: Pony Object Relational Mapper 00:47:41 – pepdocs: Read PEPs in Your Console 00:50:20 – Thanks and goodbye News: Python Release Python 3.11.0b1 Faster CPython faster-cpython/cpython: The Python programming language nogil conversation at the 2022 summit PEP 690: Lazy Imports DjangoCon Europe 2022 Call for Proposals DjangoCon US 2022 Call for Proposals Topic Links: Top Python Game Engines – In this tutorial, you’ll explore several Python game engines available to you. For each, you’ll code simple examples and a more advanced game to learn the game engine’s strengths and weaknesses. Python Decorator Patterns – Decorators are a way of wrapping functions around functions, they’re a common technique for providing pre- and post-conditions on your code. Learn about the different ways decorators get invoked and how to write each pattern. The Well-Maintained Test: 12 Questions for New Dependencies – There is lots of openly available code out there, but how do you know if you should build a dependency on some random coder’s package? 12 Questions you should ask yourself before using a library. Python’s min() and max(): Find Smallest and Largest Values – In this tutorial, you’ll learn how to use Python’s built-in min() and max() functions to find the smallest and largest values. You’ll also learn how to modify their standard behavior by providing a suitable key function. Finally, you’ll code a few practical examples of using min() and max(). Discussion: Which Python Packages Do You Use the Most? Projects: pony: Pony Object Relational Mapper pepdocs: Read PEPs in Your Console Additional Links: Eric Snow on Twitter:”We need your help making CPython faster. Publish benchmarks for your app or library.” Episode #59: Organizing and Restructuring DjangoCon Europe 2021 – The Real Python Podcast PyGame: A Primer on Game Programming in Python – Real Python Make a 2D Side-Scroller Game With PyGame – Real Python Primer on Python Decorators – Real Python The Joel Test: 12 Steps to Better Code – Joel on Software Episode #97: Improving Your Django and Python Developer Experience – The Real Python Podcast pyflakes · PyPI coverage · PyPI pudb · PyPI Django | The web framework for perfectionists with deadlines django-awl · PyPI waelstow · PyPI six · PyPI Pygments — Welcome! chardet · PyPI certifi · PyPI pandas - Python Data Analysis Library Project Jupyter | Home Bokeh Level up your Python skills with our expert-led courses: Using Pygame to Build an Asteroids Game in Python Python's map() Function: Transforming Iterables Python Decorators 101 Support the podcast & join our community of Pythonistas
undefined
May 20, 2022 • 58min

Advantages of Protobuf for Serialization in Python

Would you like a way to send structured serialized data between different platforms and languages? What if the data was self-documenting, could automatically generate Python code, and would validate itself? This week on the show, Liran Haimovitch talks about protocol buffers and communicating with microservices through Remote Procedure Calls (RPC). Protocol buffers, aka protobuf, are a language-neutral, platform-neutral system for serializing structured data. Liran talks about how they go beyond text-based protocols like JSON, providing the benefits above, along with faster transmissions and a smaller footprint. Liran shares how his company uses protobuf to communicate between their tools. We also discuss using gRPC to communicate between microservices and scaling infrastructure in either direction. Course Spotlight: Testing Your Code With pytest In this video course, you’ll learn how to take your testing to the next level with pytest. You’ll cover intermediate and advanced pytest features such as fixtures, marks, parameters, and plugins. With pytest, you can make your test suites fast, effective, and less painful to maintain. Topics: 00:00:00 – Introduction 00:01:59 – PyCon US 2022 Talk on protobuf 00:04:46 – PyCon 2019 Talk on Understanding Python’s Debugging Internals 00:05:34 – The Production-First Mindset Podcast 00:07:03 – Protobuf and serialization 00:11:17 – Static vs dynamic serializers 00:13:58 – Text vs binary serializers and metadata 00:21:08 – How long have you been using protobuf? 00:21:40 – What does it look like to set up? 00:24:45 – Video Course Spotlight 00:26:11 – Performance challenges and trade-offs 00:34:29 – Remote procedure calls 00:41:13 – Using RPC for microservices 00:47:21 – Scaling your infrastructure up or down 00:50:35 – Working across different languages 00:54:02 – What is Rookout? 00:55:11 – What are you excited about in the world of Python? 00:55:59 – What do you want to learn next? 00:56:57 – How can people learn more about what you do? 00:57:31 – Thanks and goodbye Show Links: Rookout | Painless Cloud-Native Debugging Liran Haimovitch - Understanding Python’s Debugging Internals - PyCon 2019 - YouTube The Production-First Mindset Podcast Liran Haimovitch: Effective Protobuf: Everything You Wanted To Know, But Never Dared To Ask - PyCon 2022 - YouTube Protocol Buffers  |  Google Developers Frequently Asked Questions - Protocol Buffers  |  Google Developers Thrift protocol stack — Thrift Tutorial 1.0 documentation Python Microservices With gRPC – Real Python gRPC - Modern Open Source High Performance Remote Procedure Call Framework gRPC vs REST: Understanding gRPC, OpenAPI and REST and when to use them in API design | Google Cloud Blog Welcome to PyCon US 2022 Rust Programming Language Level up your Python skills with our expert-led courses: Working With JSON in Python Testing Your Code With pytest Deploy Your Python Script on the Web With Flask Support the podcast & join our community of Pythonistas
undefined
May 13, 2022 • 57min

Start Testing Your Python with doctest & Pagination in Django

Did you know you can add testing to your Python code while simultaneously documenting it? Using docstrings, you can create examples of how your functions should interact in a Python REPL and test them with the built-in doctest module. This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects. Christopher shares an article by previous guest Mike Driscoll about testing with doctest. This is a great way to get started with testing your own code, and it offers the added benefit of documenting functionality. We talk about the recent Real Python article “Pagination for a User-Friendly Django App.” Spreading your content across multiple pages can significantly improve the user experience of your web application. This article takes you through configuring Django’s built-in pagination tool and how to combine it with other web tools. We discuss a recent article about Python type hints and the author’s disappointment. We also include reactions from a couple of online communities. We cover several other articles and projects from the Python community, including why it’s important to close files in Python, how dunder methods are awesome, a bidirectional Python dictionary, prettier git diffs, and a command-line game to learn git. Spotlight: Python Coding Interviews: Tips & Best Practices In this step-by-step course, you’ll learn how to take your Python coding interview skills to the next level and use Python’s built-in functions and modules to solve problems faster and more easily. Topics: 00:00:00 – Introduction 00:02:15 – PyCon US 2022 Follow-up 00:07:57 – Why Is It Important to Close Files in Python? 00:15:17 – Dunder Methods in Python: The Ugliest Awesome Sauce 00:24:26 – Sponsor: Mailtrap 00:25:08 – Python Testing With doctest 00:28:20 – Python Bidirectional Dictionary 00:30:27 – Pagination for a User-Friendly Django App 00:36:07 – Video Course Spotlight 00:37:27 – Python’s “Type Hints” are a bit of a disappointment to me 00:52:25 – dunk: Prettier Git Diffs 00:53:43 – git-gud: Command-Line Game to Learn git 00:55:40 – Thanks and goodbye Topic Links: Why Is It Important to Close Files in Python? – Model citizens use context managers to open and close file resources in Python, but have you ever wondered why it’s important to close files? In this tutorial, you’ll take a deep dive into the reasons why it’s important to close files and what can happen if you dont. Dunder Methods in Python: The Ugliest Awesome Sauce – Double-underscore methods, also known as “dunder methods” or “magic methods” are an ugly way of bringing beauty to your code. Learn about constructors, __repr__, __str__, operator overloading, and getting your classes working with Python functions like len(). Python Testing With doctest – Python’s doctest module allows you to write unit tests through REPL-like sessions in your docstrings. Learn how to write and execute doctest code. Also available in video. Python Bidirectional Dictionary – Learn about the Bidict library, a bidirectional dictionary where your keys and your values can both be used to look up an item. This can be a useful tool when dealing with mapped data, like country code to country name, where you want to look up either side of the relationship. Pagination for a User-Friendly Django App – In this tutorial, you’ll learn how to serve paginated content in your Django apps. Using Django pagination can significantly improve your website’s performance and give your visitors a better user experience. Discussion: Python’s “Type Hints” are a bit of a disappointment to me | Original Article Python’s “Type Hints” | Lobsters Thread Python’s “Type Hints” | Hacker News Thread Projects: dunk: Prettier Git Diffs git-gud: Command-Line Game to Learn git Additional Links: Episode #47: Unraveling Python’s Syntax to Its Core With Brett Cannon – The Real Python Podcast Python Coding Interviews: Tips & Best Practices – Real Python Episode #88: Discussing Type Hints, Protocols, and Ducks in Python – The Real Python Podcast Up and Running with Git Online Course - Talk Python Training Python’s doctest: Document and Test Your Code at Once - Real Python tutorial Level up your Python skills with our expert-led courses: Python Type Checking Python Coding Interviews: Tips & Best Practices Testing Your Code With pytest Support the podcast & join our community of Pythonistas
undefined
May 6, 2022 • 56min

Run Python in a Browser With Pyodide & The Power of f-Strings

Have you heard about the projects working toward getting Python to run in the browser? Maybe you would like to try it out for yourself, by building an interactive Python REPL with Pyodide and WebAssembly (WASM). This week on the show, Christopher Trudeau is here, and he’s brought another batch of PyCoder’s Weekly articles and projects. We talk about a step-by-step project that shows you how to build a Python code editor in the browser using WebAssembly through Pyodide and CodeMirror. You’re going to be hearing a lot about Pyodide in the coming months, and here’s a chance for you to play around while building a small project. Christopher shares an article about the power of Python f-strings. It covers some lesser-known features like variable debugging, nesting, and detailed formatting. We also have a couple of topics up for discussion this week. They’re both related to finding work as a Python developer. We cover several other articles and projects from the Python community, including the 2038 date problem, a primer about Python virtual environments, how to build a site connectivity checker in Python, a free book on digital signal processing in Python, and a project to build a voice-activated, password-protected wooden box. Spotlight: Using Python’s datetime Module Have you ever wondered about working with dates and times in Python? In this video course, you’ll learn all about the built-in Python datetime library. You’ll also learn about how to manage time zones and daylight saving time, and how to do accurate arithmetic on dates and times. Topics: 00:00:00 – Introduction 00:02:38 – 2038 Date Problem 00:07:46 – Python Virtual Environments: A Primer 00:16:06 – Python f-Strings Are More Powerful Than You Might Think 00:20:19 – Sponsor: CData Software 00:21:01 – Build an Editor in Python and WebAssembly 00:28:19 – Build a Site Connectivity Checker in Python 00:30:21 – What Jobs Can I Have Knowing Python? 00:39:53 – Video Course Spotlight 00:41:12 – Projects for a Self-Taught Dev to Help Get a Job? 00:50:46 – ThinkDSP: Free Book on Digital Signal Processing in Python 00:53:14 – Durin’s Box: Voice-Activated, Password-Protected Wooden Box 00:55:05 – Thanks and goodbye Topic Links: 2038 Date Problem (Funny, but True) – Coders old enough to remember Y2K are already dreading 2038. Join the conversation. Python Virtual Environments: A Primer – In this tutorial, you’ll learn how to use a Python virtual environment to manage your Python projects. You’ll also dive deep into the structure of virtual environments built using the venv module, as well as the reasoning behind using virtual environments. Python f-Strings Are More Powerful Than You Might Think – Learn about the lesser-known features of Python’s f-strings, including date formatting, variable debugging, nested f-strings, and conditional formatting. Build an Editor in Python and WebAssembly – Step-by-step instructions on how to build a code editor in the browser using Python and WebAssembly (WASM), via Pyodide and CodeMirror. Build a Site Connectivity Checker in Python – In this step-by-step project, you’ll build a Python site connectivity checker for the command line. While building this app, you’ll integrate knowledge related to making HTTP requests with standard-library tools, creating command-line interfaces, and managing concurrency with asyncio and aiohttp. Discussions: What Jobs Can I Have Knowing Python? Projects for a Self-Taught Dev to Help Get a Job? Projects: ThinkDSP: Free Book on Digital Signal Processing in Python Durin’s Box: Voice Activated, Password Protected, Wooden Box Additional Links: Tushar Sadhwani on Twitter: Add this to bash profile - export PIP_REQUIRE_VIRTUALENV=true Python 3’s f-Strings: An Improved String Formatting Syntax – Real Python A Guide to the Newer Python String Format Techniques – Real Python Cool New Features in Python 3.8 – Real Python “Why I Hate Frameworks”, Benji Smith (The Joel on Software Discussion Group) What are the top 10 job skills for the future? | World Economic Forum PyCoder’s Weekly | A Weekly Python E-Mail Newsletter Level up your Python skills with our expert-led courses: Using Python's datetime Module Python 3's F-Strings: An Improved String Formatting Syntax Formatting Python Strings Support the podcast & join our community of Pythonistas
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

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