The Real Python Podcast podcast

The Real Python Podcast

A weekly Python podcast hosted by Christopher Bailey with interviews, coding tips, and conversation with guests from the Python community. The show covers a wide range of topics including Python programming best practices, career tips, and related software development topics. Join us every Friday morning to hear what's new in the world of Python programming and become a more effective Pythonista.

A weekly Python podcast hosted by Christopher Bailey with interviews, coding tips, and conversation with guests from the Python community. The show covers a wide range of topics including Python programming best practices, career tips, and related software development topics. Join us every Friday morning to hear what's new in the world of Python programming and become a more effective Pythonista.

 

#198

Using Python in Bioinformatics and the Laboratory

How is Python being used to automate processes in the laboratory? How can it speed up scientific work with DNA sequencing? This week on the show, Chemical Engineering PhD Student Parsa Ghadermazi is here to discuss Python in bioinformatics. Parsa provides background on his research and the bioinformatic techniques used to discover gut microbes’ role in human health and diseases. We talk about automating lab experiments with liquid handling robots and Python. We dig into libraries to shatter and reassemble DNA sequences. Parsa also shares current projects from the Chan Lab at Colorado State University and his GitHub repository. Course Spotlight: [Building Python Project Documentation With MkDocs] (https://realpython.com/courses/building-project-documentation-mkdocs/) In this video course, you’ll learn how to build professional documentation for a Python package using MkDocs and mkdocstrings. These tools allow you to generate nice-looking and modern documentation from Markdown files and, more importantly, from your code’s docstrings. Topics: ---00:00:00 – Introduction ---00:01:51 – Engineering Background and Current PhD Program ---00:05:52 – What is Bioinformatics? ---00:08:11 – Where do you use Python in the lab? ---00:10:35 – Using lab robotics ---00:15:22 – Python development environment ---00:16:33 – Lab robotics allow for precision ---00:19:03 – How are using these tools for research? ---00:22:14 – What are the techniques for measurements? ---00:26:17 – Video Course Spotlight ---00:27:33 – How is the data output from the machine? ---00:29:20 – Moving into DNA sequencing and extraction ---00:32:08 – Shattering to work with smaller DNA sequences ---00:34:34 – Python libraries for DNA re-assembly ---00:36:28 – Building ADToolbox ---00:40:24 – How do you store the data? ---00:41:32 – Inferring microbial interactions ---00:44:02 – Types of hardware used for these projects ---00:47:07 – What are you excited about in the world of Python? ---00:48:09 – What do you want to learn next? ---00:49:16 – How can people follow your work online? ---00:50:00 – Thanks and goodbye Show Links: --- [ParsaGhadermazi - GitHub] (https://github.com/ParsaGhadermazi) --- [Bioinformatics - Wikipedia] (https://en.wikipedia.org/wiki/Bioinformatics) --- [Opentrons - Lab Automation - Lab Robots for Life Scientists] (https://opentrons.com/) --- [Tutorial — Opentrons Python API V2 Documentation] (https://docs.opentrons.com/v2/tutorial.html) --- [Serial Dilutions and Plating: Microbial Enumeration - Microbiology - JoVE] (https://www.jove.com/v/10507/serial-dilutions-and-plating-microbial-enumeration#) --- [What is Chromatogram & How to Read a Chromatogram?] (https://lab-training.com/how-to-read-a-chromatogram/) --- [Episode #186: Exploring Python in Excel] (https://realpython.com/podcasts/rpp/186/) --- [megahit: Ultra-fast and memory-efficient (meta-)genome assembler] (https://github.com/voutcn/megahit/tree/master) --- [DRAM: Distilled and Refined Annotation of Metabolism - GitHub] (https://github.com/WrightonLabCSU/DRAM) --- [humann: HUMAnN 3.0 - HMP Unified Metabolic Analysis Network] (https://github.com/biobakery/humann) --- [MetaPhlAn4 – The Huttenhower Lab] (https://huttenhower.sph.harvard.edu/metaphlan) --- [ADToolbox - Tools for modeling and optimizing the anaerobic digestion process] (https://chan-csu.github.io/ADToolbox/) --- [SPAM-DFBA - Algoritm for inferring microbial interactions] (https://chan-csu.github.io/SPAM-DFBA/) --- [Microbial interactions from a new perspective - Bioinformatics - Oxford Academic] (https://academic.oup.com/bioinformatics/article/40/1/btae003/7517107?searchresult=1) --- [Alpine — Research Computing University of Colorado Boulder documentation] (https://curc.readthedocs.io/en/latest/clusters/alpine/index.html) --- [MkDocs] (https://www.mkdocs.org/) --- [Build Your Python Project Documentation With MkDocs] (https://realpython.com/python-project-documentation-with-mkdocs/) --- [scikit-bio] (https://scikit.bio/) --- [Episode #190: Great Starting Points for Contributing to Open Source] (https://realpython.com/podcasts/rpp/190/) --- [Chan Lab at Colorado State University - GitHub] (https://github.com/chan-csu) --- [ParsaGhadermazi - GitHub] (https://github.com/ParsaGhadermazi) --- [Parsa Ghadermazi - LinkedIn] (https://www.linkedin.com/in/parsa-ghadermazi-6a3060102/) Level up your Python skills with our expert-led courses: --- [Building Python Project Documentation With MkDocs] (https://realpython.com/courses/building-project-documentation-mkdocs/) --- [Data Cleaning With pandas and NumPy] (https://realpython.com/courses/data-cleaning-with-pandas-and-numpy/) --- [Reading and Writing CSV Files] (https://realpython.com/courses/reading-and-writing-csv-files/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

22 Mar 2024

50 MINS

50:46

22 Mar 2024


#197

Exploring Duck Typing in Python & Dynamics of Monkey Patching

What are the advantages of determining the type of an object by how it behaves? What coding circumstances are not a good fit for duck typing? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. Christopher covers a recent Real Python tutorial by Leodanis Pozo Ramos titled Duck Typing in Python: Writing Flexible and Decoupled Code. The tutorial explains the concepts of duck typing within object-oriented programming and its use within Python’s built-in tools. We discuss a recent article on monkey patching in Python. This practice of dynamically modifying a class or module’s behavior at runtime allows for testing, debugging, and experimentation. We also share several other articles and projects from the Python community, including a news roundup, why names are not the same as objects in Python, using IPython Jupyter magic commands, a discussion about becoming a senior developer, a data exploration challenge, a Python evaluation game, and a terminal UI for regex testing. This week’s episode is brought to you by Sentry. Course Spotlight: [Pointers and Objects in Python] (https://realpython.com/courses/pointers-python/) In this video course, you’ll learn about Python’s object model and see why pointers don’t really exist in Python. You’ll also cover ways to simulate pointers in Python without managing memory. Topics: ---00:00:00 – Introduction ---00:02:38 – Listener feedback ---00:04:02 – DjangoCon US Call for Proposals ---00:04:38 – White House Recommends Use of Python ---00:05:41 – JupyterLab 4.1 and Notebook 7.1 Released ---00:06:05 – What’s in a Name? ---00:11:52 – Duck Typing in Python: Writing Flexible and Decoupled Code ---00:15:07 – Sponsor: Sentry ---00:16:11 – Using IPython Jupyter Magic Commands ---00:22:31 – A Guide to Monkey Patching ---00:25:27 – Falsehoods Junior Developers Believe About Becoming Senior ---00:33:01 – Video Course Spotlight ---00:34:11 – Falsehoods continued ---00:43:43 – Where in the data? ---00:46:55 – the eval game ---00:48:03 – rexi: Terminal UI for Regex Testing ---00:49:43 – Thanks and goodbye News: --- [DjangoCon US Call for Proposals] (https://2024.djangocon.us/speaking/) --- [White House Recommends Use of Python] (https://pyfound.blogspot.com/2024/02/white-house-recommends-.html) --- [JupyterLab 4.1 and Notebook 7.1 Released] (https://blog.jupyter.org/jupyterlab-4-1-and-notebook-7-1-are-here-20bfc3c10217) Show Links: --- [What’s in a Name?] (https://www.thepythoncodingstack.com/p/whats-in-a-name-python-namespace-objects-names) – An article about names in Python, and why they’re not the same as objects. The article discusses reference counts and namespaces. --- [Duck Typing in Python: Writing Flexible and Decoupled Code] (https://realpython.com/duck-typing-python/) – In this tutorial, you’ll learn about duck typing in Python. It’s a typing system based on objects’ behaviors rather than on inheritance. By taking advantage of duck typing, you can create flexible and decoupled sets of Python classes that you can use together or individually. --- [Using IPython Jupyter Magic Commands] (https://towardsdatascience.com/using-ipython-jupyter-magic-commands-to-improve-the-notebook-experience-f2c870cab356) – “IPython Jupyter Magic commands (e.g. lines in notebook cells starting with % or %%) can decorate a notebook cell, or line, to modify its behavior.” This article shows you how to define them and where they can be useful. --- [Monkeying Around With Python: A Guide to Monkey Patching] (https://dev.to/karishmashukla/monkeying-around-with-python-a-guide-to-monkey-patching-obc) – Monkey patching is the practice of modifying live code. This article shows you how it’s done and why and when to use the practice. Discussion: --- [Falsehoods Junior Developers Believe About Becoming Senior] (https://vadimkravcenko.com/shorts/falsehoods-junior-developers-believe-about-becoming-senior/) – This opinion piece by Vadim discusses how newer developers perceive what it means to be a senior developer, and how they’re often wrong. Projects: --- [Where in the data?] (https://www.whereinthedata.com/) --- [the eval game] (https://oskaerik.github.io/theevalgame/) --- [rexi: Terminal UI for Regex Testing] (https://github.com/royreznik/rexi) Additional Links: --- [Pointers in Python: What’s the Point? – Real Python] (https://realpython.com/pointers-in-python/) --- [Unlock IPython’s Magical Toolbox for Your Coding Journey – Real Python] (https://realpython.com/ipython-interactive-python-shell/) --- [Episode #88: Discussing Type Hints, Protocols, and Ducks in Python – The Real Python Podcast] (https://realpython.com/podcasts/rpp/88/) --- [saul.pw] (https://www.saul.pw/) --- [BlueBird Shell] (https://www.bluebird.sh/) Level up your Python skills with our expert-led courses: --- [Python Type Checking] (https://realpython.com/courses/python-type-checking/) --- [Testing Your Code With pytest] (https://realpython.com/courses/testing-your-code-with-pytest/) --- [Pointers and Objects in Python] (https://realpython.com/courses/pointers-python/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

15 Mar 2024

50 MINS

50:46

15 Mar 2024


#196

Building a Healthy Developer Mindset While Learning Python

How do you get yourself unstuck when facing a programming problem? How do you develop a positive developer mindset while learning Python? This week on the show, Bob Belderbos from Pybites is here to talk about learning Python and building healthy developer habits. Bob created the Pybites learning platform with his friend Julian Sequeira. They initially focused on exercises and coding challenges to motivate new Python students. As they grew their community, they created a podcast and moved into coaching. They noticed that most new developers share common struggles of tutorial paralysis, imposter syndrome, and motivation. Bob discusses techniques for developing a positive mindset, overcoming coding blocks, and delivering projects. Course Spotlight: [Grow Your Python Portfolio With 13 Intermediate Project Ideas] (https://realpython.com/courses/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: ---0:00:00 – Introduction ---0:02:06 – How did you start Pybites? ---0:04:32 – Building a community through challenges ---0:06:17 – When did you start your podcast? ---0:08:22 – Defining developer mindset ---0:11:31 – Learning Python outside of a classroom ---0:16:15 – Podcast is a good place to discuss mindset ---0:19:37 – Video Course Spotlight ---0:20:56 – Sharing Python tips ---0:30:14 – Sharing content as a creator ---0:35:03 – Writing cleaner code ---0:40:20 – Moving from challenges to projects ---0:47:08 – Helping yourself when you’re stuck ---0:51:31 – Dealing with imposter syndrome ---0:55:50 – What are you excited about in the world of Python? ---0:57:43 – What do you want to learn next? ---0:59:15 – How can people follow your work online? ---0:59:51 – Thanks and goodbye Show Links: --- [Pybites - We Create Python Developers] (https://pybit.es/) --- [Pybites Podcast] (https://www.pybitespodcast.com/) --- [PyBites Platform - Real World Python Exercises] (https://codechalleng.es/) --- [Pybites Community] (https://pybites.circle.so/c/start-here) --- [Pybites Python Tips Book - Pybites] (https://pybit.es/tips/) --- [itertools — Functions creating iterators for efficient looping - Python documentation] (https://docs.python.org/3/library/itertools.html) --- [string — Common string operations - Python documentation] (https://docs.python.org/3/library/string.html#module-string) --- [Python enumerate(): Simplify Loops That Need Counters – Real Python] (https://realpython.com/python-enumerate/) --- [ast — Abstract Syntax Trees - Python documentation] (https://docs.python.org/3/library/ast.html#abstract-grammar) --- [Building Maintainable Software, Java Edition] (https://www.oreilly.com/library/view/building-maintainable-software/9781491955987/) --- [Refactoring - Improving the Design of Existing Code by Martin Fowler] (https://martinfowler.com/books/refactoring.html) --- [A Mind For Numbers - Barbara Oakley] (https://barbaraoakley.com/books/a-mind-for-numbers/) --- [Real Imposters Don’t Experience Imposter Syndrome] (https://www.entrepreneur.com/growing-a-business/real-imposters-dont-experience-imposter-syndrome-heres/380268) --- [Rust Programming Language] (https://www.rust-lang.org/) --- [Bob Belderbos (@bbelderbos) - X] (https://twitter.com/bbelderbos) --- [Bob Belderbos - LinkedIn] (https://www.linkedin.com/in/bbelderbos/) Level up your Python skills with our expert-led courses: --- [Grow Your Python Portfolio With 13 Intermediate Project Ideas] (https://realpython.com/courses/intermediate-project-ideas/) --- [Python Basics: Code Your First Python Program] (https://realpython.com/courses/python-basics-first-program/) --- [Building Python Project Documentation With MkDocs] (https://realpython.com/courses/building-project-documentation-mkdocs/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

08 Mar 2024

1 HR 00 MINS

1:00:41

08 Mar 2024


#195

Automate Tasks With Python & Building a Small Search Engine

What are the typical computer tasks you do manually every week? Could you automate those tasks with a Python script? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. We discuss a recent Hacker News thread about frequently used automation scripts. We share the kinds of tasks we’ve automated with Python in our work and personal lives. Christopher shares a tutorial about building a micro-search engine from scratch using Python. The post takes you through coding the components of a crawler, index, and ranker. The finished engine is designed to search the posts of the blogs you follow. We also share several other articles and projects from the Python community, including a news roundup, how a Polars query works under the hood, using Python for data analysis, understanding open-source licensing, summarizing the significant changes between Python versions, a robust TUI hex editor, and a lightweight dataframe library with a universal interface for data wrangling. This week’s episode is brought to you by Intel. Course Spotlight: [Building Command Line Interfaces With argparse] (https://realpython.com/courses/python-argparse-command-line-interfaces/) In this step-by-step Python video course, you’ll learn how to take your command line Python scripts to the next level by adding a convenient command line interface that you can write with argparse. Topics: ---00:00:00 – Introduction ---00:02:23 – uv: Python Packaging in Rust ---00:02:43 – Rye Grows With uv ---00:03:20 – Python 3.13.0 Alpha 4 Is Now Available ---00:03:45 – A Bird’s Eye View of Polars ---00:07:28 – Polars: Why We Have Rewritten the String Data Type ---00:09:33 – A Search Engine in 80 Lines of Python ---00:13:14 – Using Python for Data Analysis ---00:18:22 – Sponsor: Intel ---00:18:53 – Understanding Open Source Licensing ---00:21:54 – Summary of Major Changes Between Python Versions ---00:23:19 – What Python automation scripts do you reuse frequently at work? ---00:34:21 – Video Course Spotlight ---00:35:52 – hexabyte: A modern, modular, and robust TUI hex editor ---00:39:56 – ibis: The Flexibility of Python With the Scale of Modern SQL ---00:43:31 – Thanks and goodbye News: --- [uv: Python Packaging in Rust] (https://astral.sh/blog/uv) – uv is an extremely fast Python package installer and resolver, designed as a drop-in alternative to pip and pip-tools. This post introduces you to uv and shows some of its performance numbers. --- [Rye Grows With uv - Armin Ronacher’s Thoughts and Writings] (https://lucumr.pocoo.org/2024/2/15/rye-grows-with-uv/) --- [Python 3.13.0 Alpha 4 Is Now Available] (https://pythoninsider.blogspot.com/2024/02/python-3130-alpha-4-is-now-available.html) Show Links: --- [A Bird’s Eye View of Polars] (https://pola.rs/posts/polars_birds_eye_view/) – This post on the Polars blog introduces you to how Polars works, showing the steps from queries, plans, optimizations, and then the final execution. --- [Polars: Why We Have Rewritten the String Data Type] (https://pola.rs/posts/polars-string-type/) – A large refactor on the string data type is underway in Polars. This deep dive explains why and what is changing. --- [A Search Engine in 80 Lines of Python] (https://www.alexmolas.com/2024/02/05/a-search-engine-in-80-lines.html) – In this post Alex explains how he built a micro-search engine from scratch using Python. The resulting search engine is used to search in the posts of the blogs he follows. --- [Using Python for Data Analysis] (https://realpython.com/python-for-data-analysis/) – In this tutorial, you’ll learn the importance of having a structured data analysis workflow, and you’ll get the opportunity to practice using Python for data analysis while following a common workflow process. --- [Understanding Open Source Licensing] (https://semaphoreci.com/blog/open-source-licensing) – This article discusses the importance of open-source licensing in software development and its implications for stakeholders. --- [Summary of Major Changes Between Python Versions] (https://www.nicholashairs.com/posts/major-changes-between-python-versions/) – This article is a quick reference covering the major changes introduced with each new version of Python. Can’t remember when the walrus operator was introduced? This is the place to look that up. Discussion: --- [What Python automation scripts do you reuse frequently at work? - Hacker News] (https://news.ycombinator.com/item?id=39119424) Projects --- [hexabyte: A modern, modular, and robust TUI hex editor] (https://github.com/thetacom/hexabyte) --- [ibis: The Flexibility of Python With the Scale of Modern SQL] (https://github.com/ibis-project/ibis) Additional Links: --- [Episode #193: Wes McKinney on Improving the Data Stack & Composable Systems – The Real Python Podcast] (https://realpython.com/podcasts/rpp/193/) --- [Open Source Licensing: Software Freedom and Intellectual Property Law] (https://www.oreilly.com/library/view/open-source-licensing/0131487876/) --- [What’s in which Python - Ned Batchelder] (https://nedbatchelder.com/text/which-py.html) --- [Automate the Boring Stuff with Python - Al Sweigart] (https://automatetheboringstuff.com/) --- [Working With Files in Python – Real Python] (https://realpython.com/working-with-files-in-python/) --- [Build Command-Line Interfaces With Python’s argparse – Real Python] (https://realpython.com/command-line-interfaces-python-argparse/) Level up your Python skills with our expert-led courses: --- [Defining Python Functions With Optional Arguments] (https://realpython.com/courses/defining-python-functions-with-optional-arguments/) --- [Practical Recipes for Working With Files in Python] (https://realpython.com/courses/practical-recipes-files/) --- [Building Command Line Interfaces With argparse] (https://realpython.com/courses/python-argparse-command-line-interfaces/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

01 Mar 2024

44 MINS

44:36

01 Mar 2024


#194

Wes McKinney on Improving the Data Stack & Composable Systems

How do you avoid the bottlenecks of data processing systems? Is it possible to build tools that decouple storage and computation? This week on the show, creator of the pandas library Wes McKinney is here to discuss Apache Arrow, composable data systems, and community collaboration. Wes briefly describes the humble beginnings of the pandas project in 2008 and moving the project to open source in 2011. Since then, he’s been thinking about improvements across the data processing ecosystem. Wes collaborated with members of the broader data science community to build the in-memory analytics infrastructure of Apache Arrow. Arrow avoids the bottlenecks of repeated data serialization and format conversion. He shares examples of Arrow’s use across the spectrum in tools like Polars and DuckDB. Wes advocates moving from vertically integrated tools toward composable data systems. We discuss his work on Ibis, a portable dataframe API for data manipulation and exploration in Python. Ibis supports multiple backends by decoupling the API from the execution engine. This week’s episode is brought to you by Posit Connect. Course Spotlight: [Unleashing the Power of the Console With Rich] (https://realpython.com/courses/unleash-power-rich/) Rich is a powerful library for creating text-based user interfaces (TUIs) in Python. It enhances code readability by pretty-printing complex data structures and adds visual appeal with colored text, tables, animations, and more. Topics: ---00:00:00 – Introduction ---00:02:26 – Dealing with limitations in early data science ---00:04:53 – Making pandas open source ---00:07:10 – Making changes to an existing platform ---00:12:34 – Decoupling storage and computation ---00:23:04 – Sponsor: Posit Connect ---00:23:54 – Apache Arrow solving multiple issues ---00:27:40 – DuckDB efficient analytic SQL database ---00:30:24 – Polars dataframe library ---00:31:04 – pandas 2.0 adding Arrow ---00:35:56 – Video Course Spotlight ---00:37:20 – Apache Software Foundation background ---00:41:29 – Shifting from developer to organizer and collaborator ---00:45:56 – Creating a portable query layer with Ibis ---00:55:34 – Casualties of the language wars ---00:57:57 – What’s your role at Posit? ---01:01:23 – What are you excited about in the world of Python? ---01:04:52 – What do you want to learn next? ---01:06:21 – How can people follow your work online? ---01:08:20 – Thanks and goodbye Show Links: --- [Wes McKinney - Personal Website] (https://wesmckinney.com/) --- [Wes McKinney - The Road to Composable Data Systems: Thoughts on the Last 15 Years and the Future] (https://wesmckinney.com/blog/looking-back-15-years/) --- [Wes McKinney - Leveling Up the Data Stack: Thoughts on the Last 15 Years - YouTube] (https://www.youtube.com/watch?v=XRxUeL3bQfQ) --- [Apache Hadoop] (https://hadoop.apache.org/) --- [Cloudera - The hybrid data company] (https://www.cloudera.com/) --- [Wes McKinney - Apache Arrow and the “10 Things I Hate About pandas”] (https://wesmckinney.com/blog/apache-arrow-pandas-internals/) --- [Voltron Data - The Leading Designer and Builder of Enterprise Data Systems] (https://voltrondata.com/) --- [Apache Arrow] (https://arrow.apache.org/) --- [DuckDB - An in-process SQL OLAP database management system] (https://duckdb.org/) --- [DuckDB-Wasm - Efficient Analytical SQL in the Browser] (https://duckdb.org/2021/10/29/duckdb-wasm.html) --- [Polars - Dataframes for the new era] (https://pola.rs/) --- [pandas 2.2.0 documentation] (https://pandas.pydata.org/pandas-docs/stable/index.html) --- [Episode #167: Exploring pandas 2.0 & Targets for Apache Arrow – The Real Python Podcast] (https://realpython.com/podcasts/rpp/167/) --- [ASF - Welcome to The Apache Software Foundation!] (https://www.apache.org/) --- [Ursa Labs Blog] (https://ursalabs.org/blog/) --- [Ibis - The Portable Python dataframe Library] (https://ibis-project.org/) --- [Python dataframe interchange protocol] (https://data-apis.org/dataframe-protocol/latest/) --- [Hadley Wickham] (https://hadley.nz/) --- [Rust Programming Language] (https://www.rust-lang.org/) --- [italki - Best language learning app with certificated tutors] (https://www.italki.com/) --- [Wes McKinney - LinkedIn] (https://www.linkedin.com/in/wesmckinn/) --- [Wes McKinney (@wesmckinn) - X] (https://twitter.com/wesmckinn) --- [Posit - The Open-Source Data Science Company] (https://posit.co/) Level up your Python skills with our expert-led courses: --- [Data Cleaning With pandas and NumPy] (https://realpython.com/courses/data-cleaning-with-pandas-and-numpy/) --- [Unleashing the Power of the Console With Rich] (https://realpython.com/courses/unleash-power-rich/) --- [The pandas DataFrame: Working With Data Efficiently] (https://realpython.com/courses/pandas-dataframe-working-with-data/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

23 Feb 2024

1 HR 09 MINS

1:09:20

23 Feb 2024


#193

Practical Python Decorator Uses & Avoiding datetime Pitfalls

What are real-life examples of using Python decorators? How can you harness their power in your code? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. We discuss a recent article series that digs into Python decorators. The first two articles discuss the basics of constructing decorators. The third part describes how popular Python libraries use decorators with call interception, function registration, and enriching the behavior of a function. Christopher shares a piece about the common pitfalls of working with the Pythondatetime library. The article considers how current third-party libraries don’t address most of these quirks and offers a potential solution with a new library. We also share several other articles and projects from the Python community, including a couple of news items, a discussion about the popularity of the Rust language, handling unset values in FastAPI with Pydantic, working with Python’s mini-language for formatting strings, mocking Django queryset functions, and a modern replacement for the Requests library. This week’s episode is brought to you by Sentry. Course Spotlight: [Python Decorators 101] (https://realpython.com/courses/python-decorators-101/) In this course on Python decorators, you’ll learn what they are and how to create and use them. Decorators provide a simple syntax for calling higher-order functions in Python. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it. Topics: ---00:00:00 – Introduction ---00:02:53 – Django security releases issued: 5.0.2, 4.2.10, and 3.2.24 ---00:03:10 – Python 3.12.2 and 3.11.8 are now available ---00:03:21 – Introducing PSF Grants Program Office Hours ---00:04:19 – Python’s Format Mini-Language for Tidy Strings ---00:12:22 – Ten Python datetime Pitfalls ---00:18:34 – Sponsor: Sentry ---00:19:37 – Real Life Use of Decorators ---00:29:18 – Handling Unset Values in FastAPI With Pydantic ---00:35:43 – Video Course Spotlight ---00:37:06 – The Python Rust-Aissance ---00:50:19 – django-mock-queries: Mock Django Queryset Functions ---00:53:09 – niquests: Requests but Multiplexed ---00:55:55 – Thanks and goodbye News: --- [Django security releases issued: 5.0.2, 4.2.10, and 3.2.24] (https://www.djangoproject.com/weblog/2024/feb/06/security-releases/) --- [Python 3.12.2 and 3.11.8 are now available] (https://pythoninsider.blogspot.com/2024/02/python-3122-and-3118-are-now-available.html) --- [Introducing PSF Grants Program Office Hours] (https://pyfound.blogspot.com/2024/02/introducing-psf-grants-office-hours.html) Show Links: --- [Python’s Format Mini-Language for Tidy Strings] (https://realpython.com/python-format-mini-language/) – In this tutorial, you’ll learn about Python’s format mini-language. See how to use it for creating working format specifiers and build nicely formatted strings and messages in your code. --- [Ten Python datetime Pitfalls] (https://dev.arie.bovenberg.net/blog/python-datetime-pitfalls/) – It’s no secret that the Python datetime library has its quirks. Not only are there probably more than you think, but third-party libraries don’t address most of them! Arie created a new library to explore what a better datetime library could look like. --- [Real Life Use of Decorators] (https://www.bitecode.dev/p/xmas-decorations-part-3) – Part 3 in a series on how Python decorators are used. This part covers real-life use cases including call interception, function registration, and behavioral enrichment. --- [Handling Unset Values in FastAPI With Pydantic] (https://roman.pt/posts/handling-unset-values-in-fastapi-with-pydantic/) – When using the HTTP PATCH method only those fields that got changed are updated. Pydantic sets fields not given as arguments as None so there is no way to distinguish between an explicit None value and an unset field. This post explains how you process this scenario. Discussion: --- [The Python Rust-Aissance] (https://baincapitalventures.com/insight/why-more-python-developers-are-using-rust-for-building-libraries/) – Companies like Polars are showing how with Rust, Python developers now have a better, smoother path towards building high-performance libraries. --- [Rye: A Python Developer Experience Vision Continued] (https://lucumr.pocoo.org/2024/2/4/rye-a-vision/) --- [PyO3: Rust bindings for the Python interpreter] (https://github.com/PyO3/pyo3) --- [Rust in Linux: Where we are and where we’re going next] (https://www.zdnet.com/article/rust-in-linux-where-we-are-and-where-were-going-next/) --- [RustPython: OSS CPython Written in Rust] (https://rustpython.github.io/) --- [granian: Rust HTTP Server for Python Applications] (https://github.com/emmett-framework/granian) Projects: --- [django-mock-queries: Mock Django Queryset Functions for Testing] (https://github.com/stphivos/django-mock-queries) --- [niquests: Requests but Multiplexed] (https://github.com/jawah/niquests) Additional Links: --- [Backus–Naur form - Wikipedia] (https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form) --- [ANTLR - (ANother Tool for Language Recognition) A Powerful Parser Generator] (https://www.antlr.org/) --- [Xmas Decoration, Part 1 - Bite code!] (https://www.bitecode.dev/p/xmas-decoration-part-1) --- [Xmas Decoration, Part 2 - Bite code!] (https://www.bitecode.dev/p/xmas-decoration-part-2) --- [Falsehoods programmers believe about time - @noahsussman - Infinite Undo] (https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time) --- [10 Reasons You Should Quit Your HTTP Client - Ahmed TAHRI - Dev Genius] (https://blog.devgenius.io/10-reasons-you-should-quit-your-http-client-98fd4c94bef3) --- [HTTPX - Fully Featured HTTP Client for Python 3] (https://www.python-httpx.org/) Level up your Python skills with our expert-led courses: --- [Using Python's datetime Module] (https://realpython.com/courses/python-datetime-module/) --- [Python Decorators 101] (https://realpython.com/courses/python-decorators-101/) --- [Python 3's F-Strings: An Improved String Formatting Syntax] (https://realpython.com/courses/python-3-f-strings-improved-string-formatting-syntax/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

16 Feb 2024

57 MINS

57:00

16 Feb 2024


#192

Focusing on Data Science & Less on Engineering and Dependencies

How do you manage the dependencies of a large-scale data science project? How do you migrate that project from a laptop to cloud infrastructure or utilize GPUs and multiple instances in parallel? This week on the show, Savin Goyal returns to discuss the updates to the open-source framework Metaflow. Savin briefly describes the Metaflow platform and the goal of simplifying engineering overhead for data scientists and programmers. We discuss how the platform captures snapshots of a project as you work, allowing you to go back in time or share the state of your project with another team member. We dig into the complicated process of managing dependencies for machine learning and data science projects. Savin describes how the required external libraries can be specified within a flow with the new @pypi or @conda decorators. This allows a project to scale from a local machine to the cloud or multiple instances with all dependencies included. He talks about starting a new company, Outerbounds, with fellow co-workers from Netflix. Their vision is to continue to build the Metaflow open-source platform and offer customers scalable enterprise-grade infrastructure. This week’s episode is brought to you by Intel. Course Spotlight: [Everyday Project Packaging With pyproject.toml] (https://realpython.com/courses/packaging-with-pyproject-toml/) In this Code Conversation video course, you’ll learn how to package your everyday projects with pyproject.toml. Playing on the same team as the import system means you can call your project from anywhere, ensure consistent imports, and have one file that’ll work for many build systems. Topics: ---00:00:00 – Introduction ---00:02:25 – Update on Metaflow ---00:04:13 – What is Outerbounds? ---00:07:26 – An ML platform to serve data scientists needs ---00:13:02 – Dependency reproducibility via @conda and @pypi decorators ---00:26:18 – Sponsor: Intel ---00:27:10 – Storing lock files along with snapshots ---00:29:17 – Working alongside code and dependency management systems ---00:34:03 – Scaling a project from laptop to the cloud ---00:40:13 – Video Course Spotlight ---00:41:41 – Getting visibility on processes ---00:47:23 – Adjusting your project due to GPU availability ---00:52:27 – Example of jumping back into a project one year later ---00:55:54 – What are you excited about in the world of Python? ---00:57:39 – What do you want to learn next? ---00:59:35 – How can people follow your work online? ---01:00:19 – Thanks and goodbye Show Links: --- [Metaflow - a framework for real-life ML, AI, and data science] (https://metaflow.org/) --- [Infrastructure for ML, AI, and Data Science - Outerbounds] (https://outerbounds.com/) --- [Human-Friendly, Production-Ready Data Science with Metaflow- Savin Goyal | SciPy 2022 - YouTube] (https://www.youtube.com/watch?v=KGpg8jwAda4) --- [Episode #61: Scaling Data Science and Machine Learning Infrastructure Like Netflix – The Real Python Podcast] (https://realpython.com/podcasts/rpp/61/) --- [New in Metaflow: The Long-Awaited @pypi Decorator - Outerbounds] (https://outerbounds.com/blog/pypi-announcement/) --- [Managing Dependencies - Metaflow Docs] (https://docs.metaflow.org/scaling/dependencies) --- [Secure ML with Secure Software Dependencies - Outerbounds] (https://outerbounds.com/blog/secure-ml-secure-software-dependencies/) --- [Directed acyclic graph (DAG) - Wikipedia article] (https://en.wikipedia.org/wiki/Directed_acyclic_graph) --- [Visualizing Results - Metaflow Docs] (https://docs.metaflow.org/metaflow/visualizing-results) --- [Seamless Data and ML Pipelines with Airflow and Metaflow - Outerbounds] (https://outerbounds.com/blog/seamless-data-pipelines-airflow-metaflow/) --- [Episode #142: Orchestrating Large and Small Projects With Apache Airflow – The Real Python Podcast] (https://realpython.com/podcasts/rpp/142/) --- [Savin (@SavinGoyal) - X] (https://twitter.com/SavinGoyal) --- [Savin Goyal - LinkedIn] (https://www.linkedin.com/in/savingoyal/) --- [Building the ML-driven future - Outerbounds Blog] (https://outerbounds.com/blog/) Level up your Python skills with our expert-led courses: --- [Everyday Project Packaging With pyproject.toml] (https://realpython.com/courses/packaging-with-pyproject-toml/) --- [Combining Data in pandas With concat() and merge()] (https://realpython.com/courses/data-pandas-concat-and-merge/) --- [Python Histogram Plotting: NumPy, Matplotlib, Pandas & Seaborn] (https://realpython.com/courses/python-histograms/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

09 Feb 2024

1 HR 01 MINS

1:01:20

09 Feb 2024


#191

Great Starting Points for Contributing to Open Source

What’s it like to sit down for your first developer sprint at a conference? How do you find an appropriate issue to work on as a new open-source contributor? This week on the show, author and software engineer Stefanie Molin is here to discuss starting to contribute to open-source projects. Stefanie is a data scientist and software engineer on Bloomberg’s Security Data Science team. She recently wrote an article titled “5 Ways to Get Started in Open Source.” We discuss finding ways to contribute that fit your interests and developer skills. We dig into the experience of participating in community sprints at a conference. Stefanie is the author of Hands-On Data Analysis with Pandas. We also discuss the different processes between writing technical articles and authoring a book. This week’s episode is brought to you by Intel. Course Spotlight: [Documenting Python Projects With Sphinx and Read the Docs] (https://realpython.com/courses/python-sphinx/) In this video series, you’ll create project documentation from scratch using Sphinx, the de facto standard for Python. You’ll also hook your code repository up to Read The Docs to automatically build and publish your code documentation. Topics: ---00:00:00 – Introduction ---00:02:55 – Being asked about how to get started ---00:07:13 – Differences in short vs long form writing ---00:09:03 – What was your introduction to contributing? ---00:17:52 – What are additional benefits of contributing? ---00:22:32 – Sponsor: Intel ---00:23:22 – Sprints as an entry point ---00:34:36 – Other requirements of a sprint ---00:36:05 – Differences in conferences ---00:41:52 – Other sprint experiences ---00:42:50 – Contributing examples to documentation ---00:45:59 – Video Course Spotlight ---00:47:11 – Looking for good first issues ---00:52:04 – Is this a bug? ---00:54:10 – Proposing a new feature ---00:56:36 – Data Morph and working on personal projects ---01:07:29 – Showing up in the Python community ---01:12:14 – What are you excited about in the world of Python? ---01:14:59 – How can people follow the work you do online? ---01:15:28 – What do you want to learn next? ---01:18:23 – Thanks and goodbye Show Links: --- [5 Ways to Get Started in Open Source - by Stefanie Molin - Level Up Coding] (https://levelup.gitconnected.com/5-ways-to-get-started-in-open-source-4aac430828e9) --- [seaborn: Statistical Data Visualization - Documentation] (https://seaborn.pydata.org/) --- [Docstring Validation using Pre-Commit Hook - numpydoc] (https://numpydoc.readthedocs.io/en/latest/validation.html#docstring-validation-using-pre-commit-hook) --- [Hands-On Data Analysis with Pandas: A Python data science handbook for data collection, wrangling, analysis, and visualization, 2nd Edition - Amazon.com] (https://www.amazon.com/Hands-Data-Analysis-Pandas-visualization/dp/1800563450) --- [Episode #173: Getting Involved in Open Source & Generating QR Codes With Python – The Real Python Podcast] (https://realpython.com/podcasts/rpp/173/) --- [Episode #8: Docker + Python for Data Science and Machine Learning With Tania Allard – The Real Python Podcast] (https://realpython.com/podcasts/rpp/8/) --- [Mentored Sprints for Diverse Beginners - PyCon US 2023] (https://us.pycon.org/2023/events/mentored-sprints/) --- [Episode #177: Welcoming PyPI’s Safety & Security Engineer Mike Fiedler – The Real Python Podcast] (https://realpython.com/podcasts/rpp/177/) --- [Data Morph: Moving Beyond the Datasaurus Dozen - Level Up Coding] (https://levelup.gitconnected.com/data-morph-moving-beyond-the-datasaurus-dozen-156927b20f8c) --- [Data Morph: A Cautionary Tale of Summary Statistics – Slides] (https://stefaniemolin.com/data-morph-talk/#/) --- [Anscombe’s quartet - Wikipedia] (https://en.wikipedia.org/wiki/Anscombe's_quartet) --- [Dog Speaks In Italian Accent To Sound Like His Owner - Bored Panda] (https://www.boredpanda.com/husky-speaking-italian/) --- [Stefanie Molin (@StefanieMolin) / X] (https://twitter.com/StefanieMolin) --- [Stefanie Molin - Personal Website] (https://stefaniemolin.com/) Level up your Python skills with our expert-led courses: --- [Building Python Project Documentation With MkDocs] (https://realpython.com/courses/building-project-documentation-mkdocs/) --- [Data Cleaning With pandas and NumPy] (https://realpython.com/courses/data-cleaning-with-pandas-and-numpy/) --- [Documenting Python Projects With Sphinx and Read the Docs] (https://realpython.com/courses/python-sphinx/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

02 Feb 2024

1 HR 19 MINS

1:19:27

02 Feb 2024


#190

Building a Python Debugger & Preparing for NumPy 2.0

How does a debugger work? What can you learn about Python by building one from scratch? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. Christopher shares a two-part tutorial on building a debugger in Python? Creating a simple one requires less code than you might think. We also talk about an article from Itamar Turner-Trauring about how to prepare for the upcoming changes to NumPy. The new version is not backward compatible and will require some inspection of your project dependencies. Itamar includes advice, techniques, and tools for updating your code. We also share several other articles and projects from the Python community, including a couple of news items, a discussion about managing advice as a new developer, moving to Python as a former R developer, building a Markov chain to generate readable nonsense, optimizing fonts to individual glyphs on your website, and a project for working with units of measurement in Python. This week’s episode is brought to you by Posit Connect. Course Spotlight: [Create a Tic-Tac-Toe Python Game Engine With an AI Player] (https://realpython.com/courses/python-tic-tac-toe-ai/) In this video course, you’ll create a universal game engine in Python for tic-tac-toe with two computer players, one of which will be an AI player using the powerful minimax algorithm. You’ll give your game library a text-based graphical interface and explore two front ends. Topics: ---00:00:00 – Introduction ---00:02:18 – DjangoCon Europe 2024 CFP Now Open ---00:02:38 – Python Insider: Python 3.13.0 alpha 3 is now available ---00:03:04 – NumPy 2 Is Coming: Preventing Breakage, Updating Your Code ---00:07:37 – Using a Markov Chain to Generate Readable Nonsense ---00:12:53 – Sponsor: Posit Connect ---00:13:43 – Python Rgonomics ---00:20:10 – Let’s Create a Python Debugger Together ---00:23:49 – Video Course Spotlight ---00:25:08 – Advice for New Devs Who’ve Read Other Advice Essays ---00:42:44 – Fontimize: Optimize Fonts to the Glyphs on Your Site ---00:44:57 – Pint: Units for Python ---00:46:55 – Thanks and Goodbye News: --- [DjangoCon Europe 2024 CFP Now Open] (https://www.djangoproject.com/weblog/2024/jan/01/djangocon-europe-2024-cfp/) --- [Python Insider: Python 3.13.0 alpha 3 is now available] (https://pythoninsider.blogspot.com/2024/01/python-3130-alpha-3-is-now-available.html) Show Links: --- [NumPy 2 Is Coming: Preventing Breakage, Updating Your Code] (https://pythonspeed.com/articles/numpy-2/) – NumPy 2 is coming, and it’s backwards incompatible. Learn how to keep your code from breaking, and how to upgrade. --- [Using a Markov Chain to Generate Readable Nonsense] (https://benhoyt.com/writings/markov-chain/) – Describes a simple Markov chain algorithm to generate reasonable-sounding but utterly nonsensical text, and presents some example outputs as well as a Python implementation in only 20 lines of code. --- [Python Rgonomics] (https://www.emilyriederer.com/post/py-rgo/) – If you’re coming to Python from R, this article outlines some libraries that have an R-like feel, helping you make the transition to Pythonic workflows. --- [Let’s Create a Python Debugger Together] (https://mostlynerdless.de/blog/2023/09/20/lets-create-a-python-debugger-together-part-1/) – Ever wondered how a debugger works? Implementing a simple one requires less code than you might think. Read on to find out how. Discussion: --- [Advice for New Devs Who’ve Read Other Advice Essays] (https://buttondown.email/hillelwayne/archive/advice-for-new-software-devs-whove-read-all-those/) – After reading some programming advice posts, this author decided a lot of them concentrated on the wrong things. Here is his own take. --- [Associated Hacker News Discussion] (https://news.ycombinator.com/item?id=38706697) Projects: --- [Fontimize: Optimize Fonts to the Glyphs on Your Site] (https://github.com/vintagedave/Fontimize) --- [Pint: Units for Python] (https://pypi.org/project/Pint/) Additional Links: --- [Let’s create a Python Debugger together: Part 2 - Mostly nerdless] (https://mostlynerdless.de/blog/2023/10/06/lets-create-a-python-debugger-together-part-2/) --- [“Making Hard Things Easy” by Julia Evans (Strange Loop 2023) - YouTube] (https://www.youtube.com/watch?v=30YWsGDr8mA) --- [Episode #71: Start Using a Debugger With Your Python Code – The Real Python Podcast] (https://realpython.com/podcasts/rpp/71/) --- [Debugging Rules! – Find out what’s wrong with anything, fast.] (https://debuggingrules.com/) Level up your Python skills with our expert-led courses: --- [Python Debugging With pdb] (https://realpython.com/courses/python-debugging-pdb/) --- [Using Python's assert to Debug and Test Your Code] (https://realpython.com/courses/python-assert-statement/) --- [Create a Tic-Tac-Toe Python Game Engine With an AI Player] (https://realpython.com/courses/python-tic-tac-toe-ai/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

26 Jan 2024

47 MINS

47:55

26 Jan 2024


#189

Measuring Bias, Toxicity, and Truthfulness in LLMs With Python

How can you measure the quality of a large language model? What tools can measure bias, toxicity, and truthfulness levels in a model using Python? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to discuss techniques and tools for evaluating LLMs With Python. Jodie provides some background on large language models and how they can absorb vast amounts of information about the relationship between words using a type of neural network called a transformer. We discuss training datasets and the potential quality issues with crawling uncurated sources. We dig into ways to measure levels of bias, toxicity, and hallucinations using Python. Jodie shares three benchmarking datasets and links to resources to get you started. We also discuss ways to augment models using agents or plugins, which can access search engine results or other authoritative sources. This week’s episode is brought to you by Intel. Course Spotlight: [Learn Text Classification With Python and Keras] (https://realpython.com/courses/text-classification-with-keras/) In this course, you’ll learn about Python text classification with Keras, working your way from a bag-of-words model with logistic regression to more advanced methods, such as convolutional neural networks. You’ll see how you can use pretrained word embeddings, and you’ll squeeze more performance out of your model through hyperparameter optimization. Topics: ---00:00:00 – Introduction ---00:02:19 – Testing characteristics of LLMs with Python ---00:04:18 – Background on LLMs ---00:08:35 – Training of models ---00:14:23 – Uncurated sources of training ---00:16:12 – Safeguards and prompt engineering ---00:21:19 – TruthfulQA and creating a more strict prompt ---00:23:20 – Information that is out of date ---00:26:07 – WinoBias for evaluating gender stereotypes ---00:28:30 – BOLD dataset for evaluating bias ---00:30:28 – Sponsor: Intel ---00:31:18 – Using Hugging Face to start testing with Python ---00:35:25 – Using the transformers package ---00:37:34 – Using langchain for proprietary models ---00:43:04 – Putting the tools together and evaluating ---00:47:19 – Video Course Spotlight ---00:48:29 – Assessing toxicity ---00:50:21 – Measuring bias ---00:54:40 – Checking the hallucination rate ---00:56:22 – LLM leaderboards ---00:58:17 – What helped ChatGPT leap forward? ---01:06:01 – Improvements of what is being crawled ---01:07:32 – Revisiting agents and RAG ---01:11:03 – ChatGPT plugins and Wolfram-Alpha ---01:13:06 – How can people follow your work online? ---01:14:33 – Thanks and goodbye Background Links: --- [A Beginner’s Guide to Language Models - Built In] (https://builtin.com/data-science/beginners-guide-language-models) --- [ChatGPT - Explained! - YouTube] (https://www.youtube.com/watch?v=NpmnWgQgcsA) Dataset Links: --- [truthful_qa - Datasets at Hugging Face] (https://huggingface.co/datasets/truthful_qa?row=4) --- [wino_bias - Datasets at Hugging Face] (https://huggingface.co/datasets/wino_bias) --- [bold - Datasets at Hugging Face] (https://huggingface.co/datasets/AlexaAI/bold) Tutorials and Documentation for Python Packages: --- [Evaluating Language Model Bias with 🤗 Evaluate] (https://huggingface.co/blog/evaluating-llm-bias) --- [Hugging Face - HF_bias_evaluation - Google Colab] (https://colab.research.google.com/drive/1-HDJUcPMKEF-E7Hapih0OmA1xTW2hdAv#scrollTo=yX8ciyVWKiuO) --- [General Usage - Load a Dataset - Hugging Face] (https://huggingface.co/docs/datasets/loading) --- [What is Text Generation? - Hugging Face] (https://huggingface.co/tasks/text-generation) --- [🤗 Evaluate - Library Evaluating ML Models] (https://huggingface.co/docs/evaluate/index) --- [Python Quickstart - 🦜️🔗 Langchain] (https://python.langchain.com/docs/get_started/quickstart) Measurement Links: --- [Toxicity - a Hugging Face Space by evaluate-measurement] (https://huggingface.co/spaces/evaluate-measurement/toxicity) --- [Regard - a Hugging Face Space by evaluate-measurement] (https://huggingface.co/spaces/evaluate-measurement/regard) --- [Open LLM Leaderboard - a Hugging Face Space] (https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) Training Data for LLMs: --- [Common Crawl - Open Repository of Web Crawl Data] (https://commoncrawl.org/) --- [The Pile] (https://pile.eleuther.ai/) --- [The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora] (https://arxiv.org/abs/2306.01116) Agents and Plugin Links: --- [Transformers Agents - Hugging Face] (https://huggingface.co/docs/transformers/transformers_agents) --- [Agents - 🦜️🔗 Langchain] (https://python.langchain.com/docs/modules/agents/) --- [ChatGPT Gets Its “Wolfram Superpowers”! - Stephen Wolfram] (https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/) Additional Links: --- [Inside the AI Factory: The Humans that Make Tech Seem Human - The Verge] (https://www.theverge.com/features/23764584/ai-artificial-intelligence-data-notation-labor-scale-surge-remotasks-openai-chatbots) --- [Jodie Burchell - The JetBrains Blog] (https://blog.jetbrains.com/author/jodie-burchell-jetbrains-com/) --- [Jodie Burchell’s Blog - Standard error] (https://t-redactyl.io/) --- [Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl) - Twitter] (https://twitter.com/t_redactyl) --- [Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl@fosstodon.org) - Fosstodon] (https://fosstodon.org/@t_redactyl#) --- [JetBrains: Essential tools for software developers and teams] (https://www.jetbrains.com/) Level up your Python skills with our expert-led courses: --- [Data Cleaning With pandas and NumPy] (https://realpython.com/courses/data-cleaning-with-pandas-and-numpy/) --- [Creating Web Maps From Your Data With Python Folium] (https://realpython.com/courses/python-folium-web-maps-from-data/) --- [Learn Text Classification With Python and Keras] (https://realpython.com/courses/text-classification-with-keras/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

19 Jan 2024

1 HR 15 MINS

1:15:53

19 Jan 2024


#188

Serializing Data With Python & Underscore Naming Conventions

Do you need to transfer an extensive data collection for a science project? What’s the best way to send executable code over the wire for distributed processing? What are the different ways to serialize data in Python? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. Christopher shares a tutorial by Real Python author Bartosz Zaczyński called “Serialize Your Data With Python.” This comprehensive guide moves beyond XML and JSON to explore multiple data formats and their potential use cases. It’s a deep dive into the topic and provides a thorough resource for future reference. We also discuss a Real Python tutorial about naming conventions in Python that use single and double underscores. The piece covers differentiating between public and non-public names in APIs, writing safe classes for subclassing purposes, and avoiding name clashes with keywords. We also share several other articles and projects from the Python community, including a couple of release announcements and news items, a discussion about never being taught how to construct quality software, building a small REPL in Python, using the key parameter in Python functions and methods, a framework for RESTful APIs using Flask and SQLAlchemy, and a Rust-based HTML sanitizer for your Python projects. Course Spotlight: [Writing Beautiful Pythonic Code With PEP 8] (https://realpython.com/courses/writing-beautiful-python-code-pep-8/) Learn how to write high-quality, readable code by using the Python style guidelines laid out in PEP 8. Following these guidelines helps you make a great impression when sharing your work with potential employers and collaborators. This course outlines the key guidelines laid out in PEP 8. It’s aimed at beginner to intermediate programmers. Topics: ---00:00:00 – Introduction ---00:02:47 – JIT Coming to Python 3.13 ---00:03:13 – A copy-and-patch JIT compiler - Pull Request #113465 ---00:03:54 – Django bugfix releases issued: 4.2.9 and 5.0.1 ---00:04:24 – Single and Double Underscores in Python Names ---00:16:42 – Building a Small REPL in Python ---00:20:07 – The Key to the key Parameter in Python ---00:25:23 – Video Course Spotlight ---00:26:44 – Serialize Your Data With Python ---00:30:23 – You Are Never Taught How to Build Quality Software ---00:48:43 – flask-muck: RESTful APIs Using Flask and SQLAlchemy ---00:51:26 – nh3: Python binding to Ammonia HTML sanitizer Rust crate ---00:53:33 – Thanks and goodbye News: --- [JIT Coming to Python 3.13] (https://github.com/brandtbucher/brandtbucher/blob/master/2023/10/10/a_jit_compiler_for_cpython.pdf) – Slides related to the upcoming JIT commit for Python 3.13. Note that GitHub paginates the slides if you don’t download them, so click the More Pages button to keep reading. --- [A copy-and-patch JIT compiler by brandtbucher - Pull Request #113465] (https://github.com/python/cpython/pull/113465) --- [Django bugfix releases issued: 4.2.9 and 5.0.1 - Weblog Django] (https://www.djangoproject.com/weblog/2024/jan/02/bugfix-release/) Show Links: --- [Single and Double Underscores in Python Names] (https://realpython.com/python-double-underscore/) – In this tutorial, you’ll learn a few Python naming conventions involving single and double underscores (_). You’ll learn how to use this character to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more. --- [Building a Small REPL in Python] (https://bernsteinbear.com/blog/simple-python-repl/) – Learn how to write your own REPL by building on top of the one that comes with Python. With a few lines of code, you can customize Python’s REPL environment as your own. --- [The Key to the key Parameter in Python] (https://open.substack.com/pub/thepythoncodingstack/p/the-key-to-the-key-parameter-in-python) – A parameter named key is present in several Python functions, such as sorted(). This article explores what it is and how to use it. --- [Serialize Your Data With Python] (https://realpython.com/python-serialize-data/) – In this in-depth tutorial, you’ll explore the world of data serialization in Python. You’ll compare and use different data serialization formats, serialize Python objects and executable code, and handle HTTP message payloads. Discussion: --- [You Are Never Taught How to Build Quality Software] (https://www.florianbellmann.com/blog/never-taught-qa) – Learning how to build quality software isn’t part of computer science education. How do we learn it? --- [Hacker News discussion about the article] (https://news.ycombinator.com/item?id=38570261) Projects: --- [flask-muck: RESTful APIs Using Flask and SqlAlchemy] (https://github.com/dtiesling/flask-muck) --- [nh3: Python binding to Ammonia HTML sanitizer Rust crate] (https://github.com/messense/nh3) Additional Links: --- [PEP 8: The Style Guide for Python Code] (https://pep8.org/) --- [Python’s Magic Methods: Leverage Their Power in Your Classes – Real Python] (https://realpython.com/python-magic-methods/) --- [A Philosophy of Software Design Book - John Ousterhout] (https://web.stanford.edu/~ouster/cgi-bin/book.php) --- [A Philosophy of Software Design - John Ousterhout - Talks at Google - YouTube] (https://www.youtube.com/watch?v=bmSAYlu0NcY) --- [Episode #49: The Challenges of Developing Into a Python Professional – The Real Python Podcast] (https://realpython.com/podcasts/rpp/49/) --- [Django: Sanitize Incoming HTML Fragments With nh3] (https://adamj.eu/tech/2023/12/13/django-sanitize-incoming-html-nh3/) – Allowing users to input HTML in comments or blog posts is problematic and can lead to exploits on your site. For years, the Django community used django-bleach, but since its deprecation, Adam has been using nh3, a Rust-based HTML sanitizer. --- [nh3 · PyPI] (https://pypi.org/project/nh3/) Level up your Python skills with our expert-led courses: --- [Working With JSON Data in Python] (https://realpython.com/courses/working-json-data-python/) --- [Writing Beautiful Pythonic Code With PEP 8] (https://realpython.com/courses/writing-beautiful-python-code-pep-8/) --- [Serializing Objects With the Python pickle Module] (https://realpython.com/courses/pickle-serializing-objects/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

12 Jan 2024

54 MINS

54:21

12 Jan 2024


#187

Exploring Python in Excel

Are you interested in using your Python skills within Excel? Would you like to share a data science project or visualization as a single Office file? This week on the show, we speak with Principal Architect John Lam and Sr. Cloud Developer Advocate Sarah Kaiser from Microsoft about Python in Excel. John shares the multi-year journey of adding Python to Excel. He describes how the project moved beyond writing user functions in Python to something much more elaborate. He details assembling a team with diverse skills in interface design, languages, and security. Sarah discusses the instant convenience of having familiar Python and pandas techniques at your fingertips inside Excel. We cover typical data science workflows and the potential of interactive visualizations within a spreadsheet. We also share multiple resources for you to learn more. Note: Python in Excel is currently a preview accessible by joining the Microsoft 365 Insider Program and selecting the Beta Channel. Course Spotlight: [Data Cleaning With pandas and NumPy] (https://realpython.com/courses/data-cleaning-with-pandas-and-numpy/) In this video course, you’ll learn how to clean up messy data using pandas and NumPy. You’ll become equipped to deal with a range of problems, such as missing values, inconsistent formatting, malformed records, and nonsensical outliers. Topics: ---00:00:00 – Introduction ---00:01:53 – Sr. Cloud Developer Advocate Sarah Kaiser ---00:02:46 – Principal Architect John Lam ---00:04:08 – What is Dev Div? ---00:04:33 – Python data science inside Excel ---00:09:05 – Designing features with a focus on sharing ---00:14:28 – Moving between Excel and Python objects ---00:18:20 – What libraries are imported by default? ---00:23:11 – Sharing a workbook with others ---00:26:12 – Recalculating data workflow ---00:30:07 – Working in Jupyter Notebook vs Excel ---00:33:03 – Creating a Python object ---00:33:38 – Video Course Spotlight ---00:35:02 – More history and project team ---00:40:19 – Immediate wins of having Python in Excel ---00:42:28 – Interactive visualizations ---00:44:34 – Answering security concerns ---00:49:17 – Limitations and potential ---00:54:34 – Creating demo projects ---01:00:25 – Resources to learn more ---01:02:59 – What are you excited about in the world of Python? ---01:10:41 – What do you want to learn next? ---01:12:09 – How can people follow your work online? ---01:13:26 – Thanks and goodbye Show Links: --- [Python in Excel – Python to Excel - Microsoft 365] (https://www.microsoft.com/en-us/microsoft-365/python-in-excel) --- [Get started with Python in Excel - Microsoft Support] (https://support.microsoft.com/en-us/office/get-started-with-python-in-excel-a33fbcbe-065b-41d3-82cf-23d05397f53d) --- [Python in Excel DataFrames - Microsoft Support] (https://support.microsoft.com/en-us/office/python-in-excel-dataframes-a10495b2-8372-4f0f-9179-32771fe0dc04) --- [Open-source libraries and Python in Excel - Microsoft Support] (https://support.microsoft.com/en-us/office/open-source-libraries-and-python-in-excel-c817c897-41db-40a1-b9f3-d5ffe6d1bf3e) --- [User guide and tutorial - seaborn 0.13.1 documentation] (https://seaborn.pydata.org/tutorial.html) --- [Assessing and Restoring Reproducibility of Jupyter Notebooks - IEEE Conference Publication - IEEE Xplore] (https://ieeexplore.ieee.org/document/9286024) --- [Book of Python in Excel - John Lam’s Website] (https://notes.iunknown.com/python-in-excel/Book+of+Python+in+Excel) --- [GitHub - microsoft/python-in-excel - Python in Microsoft Excel] (https://github.com/microsoft/python-in-excel) --- [Use Python in Excel to enhance your data science - Python Day - YouTube] (https://www.youtube.com/watch?v=DL2M3glz41k) --- [Introducing Python in Excel: The Best of Both Worlds for Data Analysis and Visualization - Microsoft Community Hub] (https://techcommunity.microsoft.com/t5/microsoft-365-blog/introducing-python-in-excel-the-best-of-both-worlds-for-data/ba-p/3905482) --- [PEP 703 – Making the Global Interpreter Lock Optional in CPython - peps.python.org] (https://peps.python.org/pep-0703/) --- [Dr. Sarah Kaiser (@crazy4pi314@mathstodon.xyz) - Fosstodon] (https://fosstodon.org/@crazy4pi314@mathstodon.xyz) --- [John Lam (@john_lam) - X] (https://twitter.com/john_lam) Level up your Python skills with our expert-led courses: --- [Data Cleaning With pandas and NumPy] (https://realpython.com/courses/data-cleaning-with-pandas-and-numpy/) --- [Python Histogram Plotting: NumPy, Matplotlib, Pandas & Seaborn] (https://realpython.com/courses/python-histograms/) --- [The pandas DataFrame: Working With Data Efficiently] (https://realpython.com/courses/pandas-dataframe-working-with-data/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

05 Jan 2024

1 HR 14 MINS

1:14:27

05 Jan 2024


#186

2023 Real Python Tutorial & Video Course Wrap-Up

Three members of the Real Python team are joining us this week: Kate Finegan, Tappan Moore, and Philipp Acsany. We wanted to share a year-end wrap-up with tutorials, step-by-step projects, code conversations, and video courses that showcase what our team created this year. Kate helps to shepherd articles through the multi-stage editing process. She and the rest of the team ensure these resources impart crucial Python knowledge and provide a thorough didactic experience. Kate was also instrumental in helping introduce a new group of tutorial authors to the Real Python editorial process and house style. Philipp returns to the podcast after our conversation earlier this year, and it was great to talk to him about onboarding new video instructors. Tappan edits all our video courses and ensures that the sound, picture, and animations are just right. He also helped provide feedback to the new instructors on our video creation process. We hope you enjoy this review! We look forward to bringing you another year full of great guests, articles, and topics. Course Spotlight: [Recursion in Python] (https://realpython.com/courses/python-recursion/) A recursive function is one that calls itself. In this video course, you’ll see what recursion is, how it works in Python, and under what circumstances you should use it. Topics: ---00:00:00 – Introduction ---00:02:50 – New Video Instructors ---00:05:31 – New Tutorial Authors ---00:07:37 – Shout-out to Aldren Santos ---00:09:27 – Build a Wordle Clone With Python and Rich ---00:11:37 – Python Classes: The Power of Object-Oriented Programming ---00:13:43 – SOLID Principles: Improve Object-Oriented Design in Python ---00:14:47 – Using the NumPy Random Number Generator ---00:17:58 – Recursion in Python ---00:19:44 – Filtering Iterables With Python ---00:21:04 – Creating Web Maps From Your Data With Python Folium ---00:24:51 – Video Course Spotlight ---00:26:13 – Python Basics Exercises: Building Systems With Classes ---00:31:00 – Real Python Quizzes ---00:33:53 – Process Images Using the Pillow Library and Python ---00:36:00 – How to Sort Unicode Strings Alphabetically in Python ---00:38:36 – The Python Rich Package: Unleash the Power of Console Text ---00:42:31 – Embeddings and Vector Databases With ChromaDB ---00:46:41 – Advent of Code: Solving Puzzles With Python ---00:51:07 – Thanks and goodbye Show Links: --- [Build a Wordle Clone With Python and Rich – Step-by-Step Project] (https://realpython.com/python-wordle-clone/) --- [Python Classes: The Power of Object-Oriented Programming – Tutorial] (https://realpython.com/python-classes/) --- [SOLID Principles: Improve Object-Oriented Design in Python – Tutorial] (https://realpython.com/solid-principles-python/) --- [Using the NumPy Random Number Generator – Tutorial] (https://realpython.com/numpy-random-number-generator/) --- [Recursion in Python – Video Course] (https://realpython.com/courses/python-recursion/) --- [Filtering Iterables With Python – Video Course] (https://realpython.com/courses/python-filter-function/) --- [Creating Web Maps From Your Data With Python Folium – Video Course] (https://realpython.com/courses/python-folium-web-maps-from-data/) --- [Python Basics Exercises: Building Systems With Classes – Video Course] (https://realpython.com/courses/building-systems-classes-exercises/) --- [Process Images Using the Pillow Library and Python – Video Course] (https://realpython.com/courses/python-pillow/) --- [How to Sort Unicode Strings Alphabetically in Python – Tutorial] (https://realpython.com/python-sort-unicode-strings/) --- [The Python Rich Package: Unleash the Power of Console Text – Showcase] (https://realpython.com/python-rich-package/) --- [Embeddings and Vector Databases With ChromaDB – Tutorial] (https://realpython.com/chromadb-vector-database/) --- [Advent of Code: Solving Puzzles With Python – Code Conversation] (https://realpython.com/courses/python-advent-of-code/) Additional Links: --- [Create a Python Wordle Clone With Rich – Video Course] (https://realpython.com/courses/python-wordle-clone/) --- [Class Concepts: Object-Oriented Programming in Python – Video Course] (https://realpython.com/courses/python-class-object/) --- [Inheritance and Internals: Object-Oriented Programming in Python – Video Course] (https://realpython.com/courses/python-class-inheritance/) --- [Design and Guidance: Object-Oriented Programming in Python – Video Course] (https://realpython.com/courses/solid-principles-python/) --- [FTX Python code ‘allowed’ Alameda Research to spend deposits - The Register] (https://www.theregister.com/2023/10/10/ftx_python_code/?ref=biztoc.com) --- [Recursion in Python: An Introduction – Tutorial] (https://realpython.com/python-recursion/) --- [Python’s filter(): Extract Values From Iterables – Tutorial] (https://realpython.com/python-filter-function/) --- [Python Folium: Create Web Maps From Your Data – Step-by-Step Project] (https://realpython.com/python-folium-web-maps-from-data/) --- [Episode #12: Web Scraping in Python: Tools, Techniques, and Legality – The Real Python Podcast] (https://realpython.com/podcasts/rpp/12/) --- [Python Basics: Building Systems With Classes – Video Course] (https://realpython.com/courses/python-basics-class/) --- [Image Processing With the Python Pillow Library – Tutorial] (https://realpython.com/image-processing-with-the-python-pillow-library/) --- [Episode #80: Make Your Python App Interactive With a Text User Interface (TUI) – The Real Python Podcast] (https://realpython.com/podcasts/rpp/80/) Level up your Python skills with our expert-led courses: --- [Python Basics Exercises: Building Systems With Classes] (https://realpython.com/courses/building-systems-classes-exercises/) --- [Process Images Using the Pillow Library and Python] (https://realpython.com/courses/python-pillow/) --- [Recursion in Python] (https://realpython.com/courses/python-recursion/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

29 Dec 2023

53 MINS

53:00

29 Dec 2023


#185

PyCoder's Weekly 2023 Wrap Up

It’s been a fascinating year for the Python language and community. PyCoder’s Weekly included over 1,500 links to articles, blog posts, tutorials, and projects in 2023. Christopher Trudeau is back on the show this week to help wrap up everything by sharing some highlights and Python trends from across the year. Christopher shares the top five links explored by PyCoder’s readers. We also dig into trends we noticed across all the articles and stories this year, including removing dead batteries from the standard library, continuing the effort to speed up Python, using Rust code in libraries, and moving away from microservices. We hope you enjoy this review! We look forward to bringing you an upcoming year full of great Python news, articles, topics, and projects. Course Spotlight: [Python Basics: Building Systems With Classes] (https://realpython.com/courses/python-basics-class/) In this video course, you’ll learn how to work with classes to build complex systems in Python. By composing classes, inheriting from other classes, and overriding class behavior, you’ll harness the power of object-oriented programming (OOP). Topics: ---00:00:00 – Introduction ---00:02:21 – Python 3.13.0 Alpha 2 Is Now Available ---00:02:46 – Welcoming the Supporting Developer in Residence ---00:03:25 – Django 5.0 Released ---00:03:34 – Django Ninja 1.0 Released ---00:04:11 – Top Five PyCoder Links ---00:05:00 – Python 3.12: Cool New Features for You to Try ---00:05:27 – Speeding Up Your Code When Multiple Cores Aren’t an Option ---00:05:46 – Learning About Code Metrics in Python With Radon ---00:06:07 – Python 3.12 Preview: More Intuitive and Consistent F-Strings ---00:06:28 – Design and Guidance: Object-Oriented Programming in Python ---00:07:49 – Python 3.12: What Didn’t Make the Headlines ---00:11:34 – Python 3.13 Removes 20 Stdlib Modules ---00:13:32 – Missing Batteries: Essential Libraries You’re Missing Out On ---00:16:21 – More Batteries Please ---00:19:19 – Three Python Trends in 2023 ---00:24:36 – Video Course Spotlight ---00:26:23 – Mojo, a Superset of Python ---00:27:54 – Why Mojo? ---00:28:14 – Mojo SDK Released for Linux ---00:28:19 – Mojo: Head-to-Head With Python and Numba ---00:29:22 – How We Organize Our Very Large Python Monolith ---00:34:11 – Python and Folium to Visualize My Outdoor Activities ---00:37:13 – Thanks and goodbye News: --- [Python 3.13.0 Alpha 2 Is Now Available] (https://pythoninsider.blogspot.com/2023/11/python-3130-alpha-2-is-now-available.html) --- [Welcoming the Supporting Developer in Residence] (https://discuss.python.org/t/welcoming-the-supporting-developer-in-residence/39702) --- [Django 5.0 Released] (https://www.djangoproject.com/weblog/2023/dec/04/django-50-released/) --- [Django Ninja 1.0 Released] (https://django-ninja.dev/whatsnew_v1/) Top Five PyCoder Links: --- [Python 3.12: Cool New Features for You to Try] (https://realpython.com/python312-new-features/) – In this tutorial, you’ll learn about the new features in Python 3.12. You’ll explore how the new release extends the better error messages and faster code execution found in the previous version, and you’ll try out the improvements to f-strings and type variable syntax. --- [Speeding Up Your Code When Multiple Cores Aren’t an Option] (https://pythonspeed.com/articles/optimizing-dithering/) – Parallelism isn’t the only answer: often you can optimize low-level code to get significant performance improvements. --- [Learning About Code Metrics in Python With Radon] (https://www.blog.pythonlibrary.org/2023/09/20/learning-about-code-metrics-in-python-with-radon/) – Radon is a code metrics tool. This article introduces you to it and explains how you can improve your code based on its measurements. --- [Python 3.12 Preview: More Intuitive and Consistent F-Strings] (https://realpython.com/python312-f-strings/) – In this tutorial, you’ll preview one of the upcoming features of Python 3.12, which introduces a new f-string syntax formalization and implementation. The new implementation lifts some restrictions and limitations that affect f-string literals in Python versions lower than 3.12. --- [Design and Guidance: Object-Oriented Programming in Python] (https://realpython.com/courses/solid-principles-python/) – In this video course, you’ll learn about the SOLID principles, which are five well-established standards for improving your object-oriented design in Python. By applying these principles, you can create object-oriented code that is more maintainable, extensible, scalable, and testable. Topics and 2023 Trends: --- [Python 3.12: What Didn’t Make the Headlines] (https://www.bitecode.dev/p/python-312-what-didnt-make-the-headlines) – There’s been plenty of coverage about the changes in Python 3.12. This article highlights what fell through the cracks. It talks about performance, pathlib improvements, and a few other changes. --- [Python 3.13 Removes 20 Stdlib Modules] (https://discuss.python.org/t/pep-594-has-been-implemented-python-3-13-removes-20-stdlib-modules/27124) – Core developers are busy working on [PEP 594] (https://peps.python.org/pep-0594/) , removing dead batteries from Python 3.13. This long post in the discussion forum highlights what work has been completed so far. --- [Missing Batteries: Essential Libraries You’re Missing Out On] (https://martinheinz.dev/blog/96) – Even though Python’s standard library comes with batteries included, it’s still missing some essentials. This article covers libraries for debugging, testing, CLI, and more. --- [More Batteries Please] (https://noumenal.es/posts/more-batteries-please/89w/) – This brief opinion piece from Carlton Gibson states why he thinks we need more functionality in the Python standard library rather than less. --- [Three Python Trends in 2023] (https://blog.jerrycodes.com/python-trends-in-2023/) – An opinion piece on three trends likely to attract attention in the Python world in 2023: Python/Rust co-projects, web apps, and more typing. Read on for examples in each category. --- [Mojo, a Superset of Python] (https://www.fast.ai/posts/2023-05-03-mojo-launch.html) – [Mojo] (https://docs.modular.com/mojo/) is a new programming language that’s a superset of Python. It aims to fix Python’s performance and deployment problems. Jeremy Howard - from fast.ai. --- [Why Mojo?] (https://docs.modular.com/mojo/why-mojo.html) – “A backstory and rationale for why we created the Mojo language.” Chris Lattner - from Modular. --- [Mojo SDK Released for Linux] (https://www.modular.com/blog/mojo-its-finally-here) --- [Mojo: Head-to-Head With Python and Numba] (https://dev.to/maximsaplin/mojo-head-to-head-with-python-and-numba-5bn9) – This article covers a Mandelbrot-based benchmark of Python, variations of Numba, and the newly available Mojo. Although Mojo is fast, it takes a lot more work than the author expected to translate Python to it, and with the right parameters, Numba still beats it. --- [How We Organize Our Very Large Python Monolith] (https://blog.europython.eu/kraken-technologies-how-we-organize-our-very-large-pythonmonolith/) – Kraken Technologies is an environmental tech company that does a lot of Python development. One of their applications is a monolith with over 27,000 modules. This article outlines how they keep all of this organized and running. Project: --- [Python and Folium to Visualize My Outdoor Activities] (https://hackernoon.com/how-i-used-python-and-folium-to-visualize-my-outdoor-activities) – Embark on an expedition of exploration and mapping! Learn how to breathe life into your GPX files and create interactive maps using Python and Folium. --- [Python Folium: Create Web Maps From Your Data – Real Python] (https://realpython.com/python-folium-web-maps-from-data/) --- [Creating Web Maps From Your Data With Python Folium – Real Python] (https://realpython.com/courses/python-folium-web-maps-from-data/) Additional Links: --- [Sneaky REST APIs With Django Ninja – Real Python Video Course] (https://realpython.com/courses/rest-apis-with-django-ninja/) --- [Episode #175: Exploring the New Features of Python 3.12 – The Real Python Podcast] (https://realpython.com/podcasts/rpp/175/) --- [Python 3 Module of the Week - PyMOTW 3] (https://pymotw.com/3/) --- [Episode #171: Making Each Line of Code Efficient & Python In Excel – The Real Python Podcast] (https://realpython.com/podcasts/rpp/171/) --- [psf/requests: A simple, yet elegant, HTTP library.] (https://github.com/psf/requests) --- [htmx - high power tools for html] (https://htmx.org/) Level up your Python skills with our expert-led courses: --- [Python Basics Exercises: Building Systems With Classes] (https://realpython.com/courses/building-systems-classes-exercises/) --- [Creating Web Maps From Your Data With Python Folium] (https://realpython.com/courses/python-folium-web-maps-from-data/) --- [Python Basics: Building Systems With Classes] (https://realpython.com/courses/python-basics-class/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

22 Dec 2023

38 MINS

38:20

22 Dec 2023


#184

Exploring Code Reviews in Python and Automating the Process

What goes into a code review in Python? Is there a difference in how a large organization practices code review compared to a smaller one? What do you do if you’re a solo developer? This week on the show, Brendan Maginnis and Nick Thapen from Sourcery return to talk about code review and automated code assistance. Nick and Brendan discuss their personal experiences with code reviews. From working together at a large company to starting Sourcery as a pair of developers to growing a team, they’ve experienced how various organizations review code. We discuss the importance of keeping code reviews positive and maintaining developer momentum. Nick and Brendan share techniques for automating organizational code rules and retaining institutional developer knowledge. They’ve been busy developing new features for Sourcery, moving beyond the current refactoring features. Their team is leveraging LLMs to build an automated code assistant that can perform code reviews, write tests, and answer questions about your codebase. The goal is for it to act as a personalized computer pair programmer. Course Spotlight: [Using the bpython Enhanced REPL] (https://realpython.com/courses/using-bpython-enhanced-repl/) In this video course, you’ll learn about bpython, an alternative Python REPL that brings code suggestions and many other IDE-like features to the terminal. Once you discover how much bpython can improve your productivity, you’ll never want to return to using the vanilla Python REPL again. Topics: ---00:00:00 – Introduction ---00:02:41 – Why discuss code reviewing? ---00:04:16 – What were your first code reviews like? ---00:06:31 – Developing positive techniques as a team ---00:14:07 – Time between reviews ---00:17:04 – Will the techniques vary based on the organization size? ---00:18:43 – Things to standardize and remove from code review ---00:20:06 – Video Course Spotlight ---00:22:06 – Creating a tool that goes beyond refactoring ---00:23:42 – Do newer models provide better context for code review? ---00:25:52 – Working toward an automated pair programmer ---00:33:42 – Creating rules for an organization’s code standards ---00:42:55 – Comparing completion tools with code assistance ---00:48:18 – Working on an existing codebase vs a new project ---00:52:11 – Current state of Sourcery ---00:56:19 – What are you excited about in the world of Python? ---01:00:12 – What do you want to learn next? ---01:03:41 – How can people follow your work online? ---01:05:17 – Thanks and goodbye Show Links: --- [Sourcery 1000x Faster Code Review] (https://sourcery.ai/code-review/) --- [Sourcery - GitHub Bot Install ] (https://github.com/apps/sourcery-ai/installations/select_target) --- [Sourcery - VSCode Extension - Visual Studio Marketplace] (https://marketplace.visualstudio.com/items?itemName=sourcery.sourcery) --- [Sourcery - IntelliJ IDEs Plugin] (https://plugins.jetbrains.com/plugin/12631-sourcery) --- [Episode #55: Getting Started With Refactoring Your Python Code – The Real Python Podcast] (https://realpython.com/podcasts/rpp/55/) --- [How to do a code review - eng-practices - Google GitHub] (https://google.github.io/eng-practices/review/reviewer/) --- [Generating Code without Generating Technical Debt?] (https://sourcery.ai/blog/chatgpt-maintainable-code/) --- [Episode #117: Measuring Python Code Quality, Simplicity, and Maintainability – The Real Python Podcast] (https://realpython.com/podcasts/rpp/117/) --- [Writing Custom Rules - Sourcery Documentation] (https://docs.sourcery.ai/Tutorials/Custom-Rules/) --- [Nuitka the Python Compiler - Documentation] (https://nuitka.net/) --- [Episode #154: Targeting WebAssembly Platforms & Distilling a Minimum Viable Python – The Real Python Podcast] (https://realpython.com/podcasts/rpp/154/) --- [Rust Programming Language] (https://www.rust-lang.org/) --- [Speedsolving the cube : easy-to-follow, step-by-step instructions for many popular 3-D puzzles in SearchWorks catalog] (https://searchworks.stanford.edu/view/13163262) --- [My Arcade Releases the Atari Gamestation Pro with 200+ Games] (https://atari.com/blogs/newsroom/my-arcade-releases-the-atari-gamestation-pro-with-200-games) Level up your Python skills with our expert-led courses: --- [Using the bpython Enhanced REPL] (https://realpython.com/courses/using-bpython-enhanced-repl/) --- [Testing Your Code With pytest] (https://realpython.com/courses/testing-your-code-with-pytest/) --- [Python Basics Exercises: Strings and String Methods] (https://realpython.com/courses/python-exercises-string-methods/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

08 Dec 2023

1 HR 06 MINS

1:06:06

08 Dec 2023


#183

Building a Python JSON Parser & Discussing Ideas for PEPs

Have you thought of a way to improve the Python language? How do you share your idea with core developers and start a discussion in the Python community? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. We consider a couple of Python syntax and functional ideas posted to the discussions on python.org. The first idea is for simplifying the syntax of a function’s keyword arguments, and the second is for the ability to return a NamedTuple from a function. The threads reveal steps within the Python Enhancement Proposal (PEP) process and the goal of finding a sponsor. Christopher covers a tutorial on building a JSON-like parser in Python. The project is a solid place to start if you want to learn about parsing and developing rules for recognizing syntax and extracting data. We also share several other articles and projects from the Python community, including a couple of release announcements and news items, a step-by-step guide to building a hangman game for the command line in Python, the reasons why the Django admin is supposedly ugly and ways to customize it to differentiate admin environments, an explanation of confusing git terminology, a project to extract links from a remote HTML resource, and a regex crossword game. Course Spotlight: [Advent of Code: Solving Puzzles With Python] (https://realpython.com/courses/python-advent-of-code/) Advent of Code is an online advent calendar that shares new programming puzzles each day from December 1 to the 25. In this Code Conversation, you’ll learn why solving programming puzzles can be beneficial and how you can get started with Advent of Code using Python. Topics: ---00:00:00 – Introduction ---00:02:46 – PyPI has completed its first security audit ---00:03:55 – Python Developers Survey 2023 ---00:04:45 – Wagtail 5.2 (LTS) Released ---00:05:02 – How many Python core devs use typing? ---00:07:51 – Build a Hangman Game for the Command Line in Python ---00:17:30 – Why Is the Django Admin “Ugly”? ---00:20:37 – Customize the Django Admin to Differentiate Environments ---00:22:48 – Confusing git Terminology ---00:30:01 – Video Course Spotlight ---00:31:31 – Let’s Make a Silly JSON-like Parser ---00:34:31 – Idea: Return a NamedTuple ---00:45:08 – Idea: Syntactic Sugar to Encourage Use of Named Arguments ---00:50:31 – grablinks: Extract Links From a Remote HTML Resource ---00:52:43 – Regex Crossword ---00:55:46 – Thanks and goodbye News: --- [PyPI has completed its first security audit - The Python Package Index] (https://blog.pypi.org/posts/2023-11-14-1-pypi-completes-first-security-audit/) --- [Python Developers Survey 2023] (https://survey.alchemer.com/s3/7554174/python-developers-survey-2023) --- [Wagtail 5.2 (LTS) Released] (https://docs.wagtail.org/en/latest/releases/5.2.html) --- [How many Python core devs use typing? - Gram Publishing v2] (https://blog.orsinium.dev/posts/py/core-devs-typing/) Show Links: --- [Build a Hangman Game for the Command Line in Python] (https://realpython.com/python-hangman/) – In this step-by-step project, you’ll learn how to write the game of hangman in Python for the command line. You’ll learn how to structure the game as a text-based interface (TUI) application. --- [Why Is the Django Admin “Ugly”?] (https://www.coderedcorp.com/blog/why-is-the-django-admin-ugly/) – When Vince was talking with people at DjangoCon US, one question kept coming up: Why is the Django admin so “ugly”? --- [Customize the Django Admin to Differentiate Environments] (https://406.ch/writing/customize-the-django-admin-to-differentiate-environments/) – A quick post about changing the color scheme of the Django admin depending on what environment the code is deployed within. Although Django specific, this is a great idea—visually reminding your admins and developers whether they’re in dev, staging, or production. --- [Confusing git Terminology] (https://jvns.ca/blog/2023/11/01/confusing-git-terminology/) – Julia is working on a doc that explains git and, in doing so, polled some people about what git terminology they found confusing. This post covers the most common responses and attempts to clear up the confusion. --- [Let’s Make a Silly JSON-like Parser] (https://arunmani.in/articles/silly-json-parser/) – This article goes into deep detail on how you would construct a JSON parser in Python. If you’re new to parsing, then this is a great place to start. Discussion: --- [Idea: Return a NamedTuple] (https://discuss.python.org/t/an-idea-to-allow-implicit-return-of-namedtuples/37546) --- [Idea: Syntactic Sugar to Encourage Use of Named Arguments] (https://discuss.python.org/t/syntactic-sugar-to-encourage-use-of-named-arguments/36217) Projects: --- [grablinks: Extract Links From a Remote HTML Resource] (https://github.com/the-real-tokai/grablinks) --- [Regex Crossword] (https://regexcrossword.com/) --- [Regex Crossword Mobile] (https://ole.michelsen.dk/portfolio/regexmobile/) Additional Links: --- [Episode #2: Learn Python Skills While Creating Games – The Real Python Podcast] (https://realpython.com/podcasts/rpp/2/) --- [Episode #179: Improving Your Git Developer Experience in Python – The Real Python Podcast] (https://realpython.com/podcasts/rpp/179/) --- [Write Pythonic and Clean Code With namedtuple – Real Python] (https://realpython.com/python-namedtuple/) Level up your Python skills with our expert-led courses: --- [Advent of Code: Solving Puzzles With Python] (https://realpython.com/courses/python-advent-of-code/) --- [Everyday Project Packaging With pyproject.toml] (https://realpython.com/courses/packaging-with-pyproject-toml/) --- [Writing Clean, Pythonic Code With namedtuple] (https://realpython.com/courses/python-namedtuple/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

01 Dec 2023

56 MINS

56:31

01 Dec 2023


#182

Computational Thinking & Learning Python During an AI Revolution

Has the current growth of artificial intelligence (AI) systems made you wonder what the future holds for Python developers? What are the hidden benefits of learning to program in Python and practicing computational thinking? This week on the show, we speak with author Lawrence Gray about his upcoming book “Mastering Python: A Problem Solving Approach.” Lawrence shares how learning Python helped him through a dark and trying time. He developed lifelong skills that he wants to pass along through teaching and authoring a book. We discuss what you can do to prepare for a future where coding jobs are automated through AI. He shares ways that Python can help build the higher-order thinking skills required by future careers. We also talk about how Python can help with computational thinking and promote cognitive development. This week’s episode is brought to you by Site24x7. Course Spotlight: [Looping With Python enumerate()] (https://realpython.com/courses/looping-with-python-enumerate/) Once you learn about for loops in Python, you know that using an index to access items in a sequence isn’t very Pythonic. So what do you do when you need that index value? In this course, you’ll learn all about Python’s built-in enumerate(), where it’s used, and how you can emulate its behavior. Topics: ---00:00:00 – Introduction ---00:02:29 – Learning Python and changing how you think ---00:05:07 – What is the goal of the book? ---00:05:59 – Discovering Python during a dark period ---00:10:32 – What is unique to Python that helped you? ---00:12:43 – How did you start teaching Python? ---00:14:40 – Teaching Python to art students ---00:18:52 – Sponsor: Site24x7.com ---00:19:48 – Why write about computational thinking? ---00:21:55 – Why learn Python now? ---00:25:18 – Multiple modalities for Python ---00:29:32 – Other optimistic thoughts on the future ---00:34:15 – Reskilling a workforce ---00:37:16 – What skills can be developed? ---00:41:13 – Video Course Spotlight ---00:42:40 – Bloom’s taxonomy ---00:48:00 – Sharing the positive impact of Python ---00:50:26 – What are you excited about in the world of Python? ---00:51:32 – What do you want to learn next? ---00:52:45 – How can people follow your work online? ---00:52:47 – Thanks and goodbye Show Links: --- [The Future of Jobs Report 2023 - World Economic Forum] (https://www.weforum.org/publications/the-future-of-jobs-report-2023/digest/) --- [Mastering Python: Get Access to Chapter 1] (http://www.lawrencegray.com/mastering-python-book) --- [Computational thinking - Wikipedia] (https://en.wikipedia.org/wiki/Computational_thinking) --- [Bloom’s taxonomy - Wikipedia] (https://en.wikipedia.org/wiki/Bloom's_taxonomy) --- [Probably Overthinking It – Data science, Bayesian Statistics, and other ideas] (https://www.allendowney.com/blog/) --- [scikit-learn: machine learning in Python - documentation] (https://scikit-learn.org/stable/index.html) --- [Yellowbrick: Machine Learning Visualization - documentation] (https://www.scikit-yb.org/en/latest/index.html) --- [PyCon US 2024 - PyCon US 2024] (https://us.pycon.org/2024/) --- [Education Summit - PyCon US 2023] (https://us.pycon.org/2023/events/education-summit/index.html) --- [PyTorch - Get Started] (https://pytorch.org/get-started/locally/) --- [Lawrence Gray Personal Site] (https://www.lawrencegray.com/python) Level up your Python skills with our expert-led courses: --- [Using k-Nearest Neighbors (kNN) in Python] (https://realpython.com/courses/knn-python/) --- [How to Write Pythonic Loops] (https://realpython.com/courses/how-to-write-pythonic-loops/) --- [Looping With Python enumerate()] (https://realpython.com/courses/looping-with-python-enumerate/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

17 Nov 2023

54 MINS

54:12

17 Nov 2023


#181

Studying Python Software Architecture & Creating Lambda Expressions

Have you moved through the fundamentals of Python, and are you now considering building a more extensive project or complete application? Where can you study the architecture of existing Python projects and learn best practices? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects. We discuss a set of resources that developers can study to learn how to structure projects. The collection was shared in a blog post titled “Great Resources a Beginner Might Not Find So Easily.” It includes a pair of books on the architecture of large software applications and another aimed at more modest projects. We consider when you should use lambda expressions in your Python code. These one-line expressions create anonymous functions. How do they differ from standard functions, and where is it appropriate to use them? We also share several other articles and projects from the Python community, including a couple of release announcements, an explanation of Python as a compiled language, a discussion covering the controversy about the recent Flask release, a project for writing less Selenium code, and a project to create ASCII art with Python. This week’s episode is brought to you by Site24x7. Course Spotlight: [Design and Guidance: Object-Oriented Programming in Python] (https://realpython.com/courses/solid-principles-python/) In this video course, you’ll learn about the SOLID principles, which are five well-established standards for improving your object-oriented design in Python. By applying these principles, you can create object-oriented code that is more maintainable, extensible, scalable, and testable. Topics: ---00:00:00 – Introduction ---00:02:50 – PyCon US 2024 Call for Proposals ---00:03:18 – Django 5.0 Beta 1 Released ---00:03:29 – Django security releases issued: 4.2.7, 4.1.13, and 3.2.23 ---00:03:51 – The Ruff Formatter: Python’s Fastest Formatter ---00:04:50 – What Are Lambda Expressions? ---00:12:01 – Sponsor: Site24x7.com ---00:12:56 – Python Is a Compiled Language ---00:16:01 – Great Resources a Beginner Might Not Find So Easily ---00:27:01 – Video Course Spotlight ---00:28:32 – We Have to Talk About Flask ---00:41:46 – selenium-python-helium: Write Less Selenium Code ---00:45:23 – pyfiglet: An implementation of figlet written in Python ---00:47:17 – Thanks and goodbye News: --- [PyCon US 2024 Call for Proposals] (https://pretalx.com/pyconus2024/) --- [Django 5.0 Beta 1 Released] (https://www.djangoproject.com/weblog/2023/oct/23/django-50-beta-1-released/) --- [Django security releases issued: 4.2.7, 4.1.13, and 3.2.23 | Weblog | Django] (https://www.djangoproject.com/weblog/2023/nov/01/security-releases/) --- [The Ruff Formatter: Python’s Fastest Formatter] (https://www.blog.pythonlibrary.org/2023/10/25/the-ruff-formatter-pythons-fastest-formatter/) – You may have come across Ruff, a linter that’s been on the scene for about a year. Well, it recently added formatting to its features. This article shows you how, including the configuration option to allow single-quote style. Show Links: --- [What Are Lambda Expressions?] (https://www.pythonmorsels.com/lambda-expressions/) – This post teaches you what lambda expressions are and how they get used in Python. It shows several examples and also covers when to avoid lambda expressions. --- [Python Is a Compiled Language] (https://eddieantonio.ca/blog/2023/10/25/python-is-a-compiled-language/) – Python is interpreted, but it interprets compiled code. This distinction can be confusing to students, and this instructor does a deep dive on where the line between the concepts sits. --- [Great Resources a Beginner Might Not Find So Easily] (https://death.andgravity.com/aosa) – Are you having trouble making the modules work together in a larger project? Have you tried looking at popular projects as models, but did their size and scope put you off? Did you find it hard to see why they did what they did? Resources about this do exist, but they’re scattered all over…unless you know where to look. --- [We Have to Talk About Flask] (https://blog.miguelgrinberg.com/post/we-have-to-talk-about-flask) – The most recent release of Flask and Werkzeug have introduced backward incompatible changes that are affecting popular add-ons. Miguel writes about how this is a common occurrence and why it keeps happening. Discussion: --- [Armin Ronacher on X: Flask today is a different framework than the one I have created] (https://twitter.com/mitsuhiko/status/1719716779532931466) --- [Some More To Talk About Flask - miguelgrinberg.com] (https://blog.miguelgrinberg.com/post/some-more-to-talk-about-flask) --- [We Have to Talk About Flask - Hacker News] (https://news.ycombinator.com/item?id=37944326) --- [Episode #18: Ten Years of Flask: Conversation With Creator Armin Ronacher - The Real Python Podcast] (https://realpython.com/podcasts/rpp/18/#t=3613) Projects: --- [selenium-python-helium: Write Less Selenium Code] (https://github.com/mherrmann/selenium-python-helium) --- [pyfiglet: An implementation of figlet written in Python - PyPI] (https://pypi.org/project/pyfiglet/) Additional Links: --- [Lambdas - Expressions - Python 3.12.0 documentation] (https://docs.python.org/3/reference/expressions.html#lambda) --- [How to Use Python Lambda Functions - Real Python] (https://realpython.com/python-lambda/#appropriate-uses-of-lambda-expressions) --- [The Architecture of Open Source Applications] (http://aosabook.org/en/index.html#aosa2) --- [Episode #9: Leveling Up Your Python Literacy and Finding Python Projects to Study - The Real Python Podcast] (https://realpython.com/podcasts/rpp/9/) --- [Episode #62: Selecting the Ideal Data Structure & Unravelling Python’s “pass” and “with” - The Real Python Podcast] (https://realpython.com/podcasts/rpp/62/) --- [asciimatics - PyPI] (https://pypi.org/project/asciimatics/) Level up your Python skills with our expert-led courses: --- [Class Concepts: Object-Oriented Programming in Python] (https://realpython.com/courses/python-class-object/) --- [Design and Guidance: Object-Oriented Programming in Python] (https://realpython.com/courses/solid-principles-python/) --- [Inheritance and Internals: Object-Oriented Programming in Python] (https://realpython.com/courses/python-class-inheritance/) [Support the podcast & join our community of Pythonistas] (https://realpython.com/join) ... Read more

10 Nov 2023

48 MINS

48:17

10 Nov 2023