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
The Real Python Podcast

The Real Python Podcast

Technology

Package Python Code With pyproject.toml & Listing Files With pathlib

Package Python Code With pyproject.toml & Listing Files With pathlib

2022-12-09
Download Right click and do "save link as"

How do you start packaging your code with pyproject.toml? Would you like to join a conversation that gently walks you through setting up your Python projects to share? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.

We discuss a recent code conversation featuring Real Python team members Ian Currie and Geir Arne Hjelle. The video dives into the officially sanctioned way to configure your project using a pyproject.toml file. We cover how this relatively new approach will help you package your code for use on your system or for sharing with others.

Christopher shares a Real Python tutorial about using pathlib to get a list of all the files within a directory. We’re both fans of pathlib and how it simplifies working with file paths. The tutorial digs into methods to recursively list all directory contents or create a conditional listing.

We share several other articles and projects from the Python community, including an explanation of Python bytecode, an argument for always using [closed, open) intervals, a discussion about building the monolith before microservices, a way to parse natural language time and date expressions, and a project for posting on Mastodon.

Course Spotlight: Using Python’s pathlib Module

In this video course, you’ll learn how to effectively work with file system paths in Python 3 using the pathlib module in the standard library.

Topics:

  • 00:00:00 – Introduction
  • 00:02:30 – Always Use [closed, open) Intervals
  • 00:07:05 – Everyday Project Packaging With pyproject.toml
  • 00:15:38 – Sponsor: InfluxDB
  • 00:16:27 – How to Get a List of All Files in a Directory With Python
  • 00:20:37 – Python Bytecode Explained
  • 00:29:39 – Video Course Spotlight
  • 00:30:48 – Build the Modular Monolith First
  • 00:44:34 – toot - PyPI
  • 00:49:58 – quickadd: Parse Natural Language Time and Date Expressions
  • 00:53:09 – Thanks and goodbye

Show Links:

  • Always Use [closed, open) Intervals – “Intervals or ranges pop-up everywhere in the programming world. The classic example is picking a start and end date, like you would when booking an AirBnB or a flight. Have you ever wondered why they are always implemented as [closed, open) as opposed to [closed, closed]?”
  • Everyday Project 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.
  • How to Get a List of All Files in a Directory With Python – In this tutorial, you’ll be examining a couple of methods to get a list of files and folders in a directory with Python. You’ll also use both methods to recursively list directory contents. Finally, you’ll examine a situation that pits one method against the other.
  • Python Bytecode Explained – When a Python program is run, the interpreter first parses your code and checks for syntax errors, then it translates it into bytecode instructions. This article explains some of the features of Python bytecode.

Discussion:

  • Build the Modular Monolith First – “Even talking about building a monolith today, is a bit taboo. It is all about microservices at the moment, and has been for a few years. But they aren’t a silver bullet.” Coding samples in the article aren’t Python, but the architectural advice is cross-language.
  • Microservices and the First Law of Distributed Objects
  • “I’m convinced that one of the biggest architectural mistakes of the past decade was going full microservice” Jason Warner - Twitter

Projects:

  • toot - PyPI
  • quickadd: Parse Natural Language Time and Date Expressions

Additional Links:

  • Packaging Your Python Code With pyproject.toml | Complete Code Conversation - YouTube
  • How to Publish an Open-Source Python Package to PyPI – Real Python
  • Publishing Python Packages: Test, share, and automate your projects | Dane Hillard
  • Episode #83: Ready to Publish Your Python Packages? – The Real Python Podcast
  • Advanced Course on Python3 - MoserMichael - GitHub
  • pyasmtool: Explores the Python bytecode, provides some tools to access it for fun and profit. - GitHub
  • Episode #39: Generators, Coroutines, and Learning Python Through Exercises – The Real Python Podcast
  • Episode #47: Unraveling Python’s Syntax to Its Core With Brett Cannon – The Real Python Podcast
  • MVPy: Minimum Viable Python
  • Episode #124: Exploring Recursion in Python With Al Sweigart – The Real Python Podcast
  • Microservices and the First Law of Distributed Objects
  • Mastodon for Python Devs - Talk Python #390
  • Mastodon is just blogs
  • ActivityPub
  • The Top 239 Activitypub Open Source Projects
  • A 🦣 opportunity for developers - DEV Community 👩‍💻👨‍💻
  • Getting Started with Mastodon API in Python | Martin Heinz - Medium
  • Christopher Trudeau (@cltrudeau) - Twitter
  • Christopher Bailey | (@digiglean) - Twitter
  • Christopher Bailey (@digiglean@fosstodon.org) - Fosstodon
  • Real Python (@realpython@fosstodon.org) - Fosstodon

Level up your Python skills with our expert-led courses:

  • Lists and Tuples in Python
  • Everyday Project Packaging With pyproject.toml
  • Using Python's pathlib Module

Support the podcast & join our community of Pythonistas

view more

More Episodes

Continuing to Improve the Learning Experience at Real Python
2026-01-23
Considering Fast and Slow in Python Programming
2026-01-16
Coding Python With Confidence: Beginners Live Course Participants
2026-01-09
PyCoder's Weekly 2025 Top Articles & Hidden Gems
2026-01-02
Moving Towards Spec-Driven Development
2025-12-19
Exploring Quantum Computing & Python Frameworks
2025-12-05
Building a FastAPI Application & Exploring Python Concurrency
2025-11-21
Preparing Data Science Projects for Production
2025-11-14
Advice for Writing Maintainable Python Code
2025-11-07
Michael Kennedy: Managing Your Own Python Infrastructure
2025-10-31
Benchmarking Python 3.14 & Enabling Asyncio to Scale
2025-10-24
Evolving Teaching Python in the Classroom
2025-10-17
Python 3.14: Exploring the New Features
2025-10-10
Advice on Beginning to Learn Python
2025-10-03
Managing Feature Flags & Comparing Python Visualization Libraries
2025-09-26
Dangers of Automatically Converting a REST API to MCP
2025-09-19
Python App Hosting Choices & Documenting Python's History
2025-09-12
Large Language Models on the Edge of the Scaling Laws
2025-09-05
Exploring Mixin Classes in Python
2025-08-29
Travis Oliphant: SciPy, NumPy, and Fostering Scientific Python
2025-08-22
  • ←
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • →
012345678910111213141516171819

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-2026 Podbean.com