Podbean logo
  • Discover
  • Podcast Features
    • Podcast Hosting

      Start your podcast with all the features you need.

    • Podbean AI Podbean AI

      AI-Enhanced Audio Quality and Content Generation.

    • Blog to Podcast

      Repurpose your blog into an engaging podcast.

    • Video to Podcast

      Convert YouTube playlists to podcasts, videos to audios.

  • Monetization
    • Ads Marketplace

      Join Ads Marketplace to earn through podcast sponsorships.

    • PodAds

      Manage your ads with dynamic ad insertion capability.

    • Apple Podcasts Subscriptions Integration

      Monetize with Apple Podcasts Subscriptions via Podbean.

    • Live Streaming

      Earn rewards and recurring income from Fan Club membership.

  • Podbean App
    • Podcast Studio

      Easy-to-use audio recorder app.

    • Podcast App

      The best podcast player & podcast app.

  • Help and Support
    • Help Center

      Get the answers and support you need.

    • Podbean Academy

      Resources and guides to launch, grow, and monetize podcast.

    • Podbean Blog

      Stay updated with the latest podcasting tips and trends.

    • What’s New

      Check out our newest and recently released features!

    • Podcasting Smarter

      Podcast interviews, best practices, and helpful tips.

  • Popular Topics
    • How to Start a Podcast

      The step-by-step guide to start your own podcast.

    • How to Start a Live Podcast

      Create the best live podcast and engage your audience.

    • How to Monetize a Podcast

      Tips on making the decision to monetize your podcast.

    • How to Promote Your Podcast

      The best ways to get more eyes and ears on your podcast.

    • Podcast Advertising 101

      Everything you need to know about podcast advertising.

    • Mobile Podcast Recording Guide

      The ultimate guide to recording a podcast on your phone.

    • How to Use Group Recording

      Steps to set up and use group recording in the Podbean app.

  • All Arts Business Comedy Education
  • Fiction Government Health & Fitness History Kids & Family
  • Leisure Music News Religion & Spirituality Science
  • Society & Culture Sports Technology True Crime TV & Film
  • Live
  • How to Start a Podcast
  • How to Start a Live Podcast
  • How to Monetize a podcast
  • How to Promote Your Podcast
  • How to Use Group Recording
  • Log in
  • Start your podcast for free
  • Podcasting
    • Podcast Features
      • Podcast Hosting

        Start your podcast with all the features you need.

      • Podbean AI Podbean AI

        AI-Enhanced Audio Quality and Content Generation.

      • Blog to Podcast

        Repurpose your blog into an engaging podcast.

      • Video to Podcast

        Convert YouTube playlists to podcasts, videos to audios.

    • Monetization
      • Ads Marketplace

        Join Ads Marketplace to earn through podcast sponsorships.

      • PodAds

        Manage your ads with dynamic ad insertion capability.

      • Apple Podcasts Subscriptions Integration

        Monetize with Apple Podcasts Subscriptions via Podbean.

      • Live Streaming

        Earn rewards and recurring income from Fan Club membership.

    • Podbean App
      • Podcast Studio

        Easy-to-use audio recorder app.

      • Podcast App

        The best podcast player & podcast app.

  • Advertisers
  • Enterprise
  • Pricing
  • Resources
    • Help and Support
      • Help Center

        Get the answers and support you need.

      • Podbean Academy

        Resources and guides to launch, grow, and monetize podcast.

      • Podbean Blog

        Stay updated with the latest podcasting tips and trends.

      • What’s New

        Check out our newest and recently released features!

      • Podcasting Smarter

        Podcast interviews, best practices, and helpful tips.

    • Popular Topics
      • How to Start a Podcast

        The step-by-step guide to start your own podcast.

      • How to Start a Live Podcast

        Create the best live podcast and engage your audience.

      • How to Monetize a Podcast

        Tips on making the decision to monetize your podcast.

      • How to Promote Your Podcast

        The best ways to get more eyes and ears on your podcast.

      • Podcast Advertising 101

        Everything you need to know about podcast advertising.

      • Mobile Podcast Recording Guide

        The ultimate guide to recording a podcast on your phone.

      • How to Use Group Recording

        Steps to set up and use group recording in the Podbean app.

  • Discover
  • Log in
    Sign up free
Python Bytes

Python Bytes

Technology

#246 Love your crashes, use Rich to beautify tracebacks

#246 Love your crashes, use Rich to beautify tracebacks

2021-08-11
Download Right click and do "save link as"

Watch the live stream:

Watch on YouTube

About the show

Sponsored by us:

  • Check out the courses over at Talk Python
  • And Brian’s book too!

Special guest: David Smit

Brain #1: mktestdocs

  • Vincent D. Warmerdam
  • Tutorial with videos
  • Utilities to check for valid Python code within markdown files and markdown formatted docstrings.
  • Example:
import pathlib import pytest from mktestdocs import check_md_file @pytest.mark.parametrize('fpath', pathlib.Path("docs").glob("**/*.md"), ids=str) def test_files_good(fpath): check_md_file(fpath=fpath)
  • This will take any codeblock that starts with ```python and run it, checking for any errors that might happen.
  • Putting assert statements in the code block will actually check things.
  • Other examples in README.md for markdown formatted docstrings from functions and classes.
  • Suggested usage is for code in mkdocs documentation.
  • I’m planning on trying it with blog posts.

Michael #2: Redis powered queues (QR3)

  • via Scot Hacker
  • QR queues store serialized Python objects (using cPickle by default), but that can be changed by setting the serializer on a per-queue basis.
  • There are a few constraints on what can be pickled, and thus put into queues
  • Create a queue:
  • bqueue = Queue('brand_new_queue_name', host='localhost', port=9000)
  • Add items to the queue
>> bqueue.push('Pete') >> bqueue.push('John') >> bqueue.push('Paul') >> bqueue.push('George')
  • Getting items out
>> bqueue.pop() 'Pete'
  • Also supports deque, or double-ended queue, capped collections/queues, and priority queues.

David #3: 25 Pandas Functions You Didn’t Know Existed

  • Bex T
  • So often, I come across a pandas method or function that makes me go “AH!” because it saves me so much time and simplifies my code
    • Example: Transform
  • Don’t normally like these articles, but this one had several “AH” moments
    • between
    • styler
    • options
    • convert dtypes
    • mask
    • nasmallest, nalargest
    • clip
    • attime

Brian #4: FastAPI and Rich Tracebacks in Development

  • Hayden Kotelman
  • Rich has, among other cool features, beautiful tracebacks and logging.
  • FastAPI makes it easy to create web API’s
  • This post shows how to integrate the two for API’s that are easy to debug.
  • It’s really only a few simple steps
    • Create a dataclass for the logger config.
    • Create a function that will either install rich as the handler (while not in production) or use the production log configuration.
    • Call logging.basicConfig() with the new settings.
    • And possibly override the logger for Uvicorn.
  • Article contains all code necessary, including examples of the resulting logging and tracebacks.

Michael #5: Dev in Residence

  • I am the new CPython Developer in Residence
  • Report on first week
  • Łukasz Langa: “When the PSF first announced the Developer in Residence position, I was immediately incredibly hopeful for Python. I think it’s a role with transformational potential for the project. In short, I believe the mission of the Developer in Residence (DIR) is to accelerate the developer experience of everybody else.”
  • The DIR can:
    • providing a steady review stream which helps dealing with PR backlog;
    • triaging issues on the tracker dealing with issue backlog;
    • being present in official communication channels to unblock people with questions;
    • keeping CI and the test suite in usable state which further helps contributors focus on their changes at hand;
    • keeping tabs on where the most work is needed and what parts of the project are most important.

David #6: Dagster

  • Dagster is a data orchestrator for machine learning, analytics, and ETL
  • Great for local development that can be deployed on Kubernetes, etc
  • Dagit provides a rich UI to monitor the execution, view detailed logs, etc
  • Can deploy to Airflow, Dask, etc
  • Quick demo?
  • References
    • https://www.dataengineeringpodcast.com/dagster-data-applications-episode-104/
    • https://softwareengineeringdaily.com/2019/11/15/dagster-with-nick-schrock/

Extras

Michael:

  • Get a vaccine, please.
  • Python 3.10 Type info ---- er Make the 3.9, thanks John Hagen. Here is a quick example. All of these are functionally equivalent to PyCharm/mypy:
# Python 3.5-3.8 from typing import List, Optional def fun(l: Optional[List[str]]) -> None: # Python 3.9+ from typing import Optional def fun(l: Optional[list[str]]) -> None: # Python 3.10+ def fun(l: list[str] | None) -> None:

Note how with 3.10 we no longer need any imports to represent this type.

David:

  • Great SQL resource

Joke: Pray

view more

More Episodes

#11 Django 2.0 is dropping Python 2 entirely, pipenv for profile functionality, and Pythonic home automation
2017-01-31
#10 Dismissing Python's Garbage Collection, PyPI Name Reservations, and Hackers Exfiltrate US Government Data to Save Itself
2017-01-23
#9 Walking with async coroutines, diving deep into requests, and a universe of options (for AIs)
2017-01-17
#8 Python gets Grumpy, avoiding burnout, Postman for API testing and more
2017-01-10
#7 Python 3.6 is out, Sanic is a blazing web framework, and are failing our open source infrastructure?
2017-01-04
#6 Python 3.6 is going to be awesome, Kite: your friendly co-developing AI
2016-12-12
#5 Legacy Python vs Python and why words matter and Request's 5 Whys retrospective
2016-12-05
#4 Python 3 is just fine for beginners thank you, q is awesome for debugging, and more
2016-11-29
#3 Python 3.6 is coming, and it's awesome plus superior text processing with Pynini
2016-11-23
#2 PyCon, awesome python, python developer job prospects, and more
2016-11-14
#1 Intro to the show and pip 9 is out!
2016-11-07
  • ←
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • →
012345678910

Get this podcast on your
phone, FREE

Download Podbean app on App Store Download Podbean app on Google Play

Create your
podcast in
minutes

  • Full-featured podcast site
  • Unlimited storage and bandwidth
  • Comprehensive podcast stats
  • Distribute to Apple Podcasts, Spotify, and more
  • Make money with your podcast
Get started

It is Free

  • Podcast Services

    • Podcast Features
    • Pricing
    • Enterprise Solution
    • Private Podcast
    • The Podcast App
    • Live Stream
    • Audio Recorder
    • Remote Recording
    • Podbean AI
  •  
    • Create a Podcast
    • Video Podcast
    • Start Podcasting
    • Start Radio Talk Show
    • Education Podcast
    • Church Podcast
    • Nonprofit Podcast
    • Get Sermons Online
    • Free Audiobooks
  • MONETIZATION & MORE

    • Podcast Advertising
    • Dynamic Ads Insertion
    • Apple Podcasts Subscriptions
    • Switch to Podbean
    • YouTube to Podcast
    • Blog to Podcast
    • Submit Your Podcast
    • Podbean Plugins
    • Developers
  • KNOWLEDGE BASE

    • How to Start a Podcast
    • How to Start a Live Podcast
    • How to Monetize a Podcast
    • How to Promote Your Podcast
    • Mobile Podcast Recording Guide
    • How to Use Group Recording
    • Podcast Advertising 101
  • Support

    • Support Center
    • What’s New
    • Free Webinars
    • Podcast Events
    • Podbean Academy
    • Podbean Amplified Podcast
    • Badges
    • Resources
  • Podbean

    • About Us
    • Podbean Blog
    • Careers
    • Press and Media
    • Green Initiative
    • Affiliate Program
    • Contact Us
  • Privacy Policy
  • Cookie Policy
  • Terms of Use
  • Consent Preferences
  • Copyright © 2015-2025 Podbean.com