PLAY PODCASTS
Building a Hash Table in Python and Thoughtful REST API Design
Episode 104

Building a Hash Table in Python and Thoughtful REST API Design

The Real Python Podcast · Real Python

April 1, 202253m 3s

Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

<p>Do you understand how a hash table works? What if you could learn about building one while practicing test-driven development? What are best practices when designing a REST API? This week on the show, Christopher Trudeau is here, and he&rsquo;s brought another batch of PyCoder&rsquo;s Weekly articles and projects.</p> <p>We talk about the recent Real Python article &ldquo;Build a Hash Table in Python With TDD.&rdquo; The tutorial shows how to implement a hash table prototype from scratch in Python. It also provides a hands-on crash course in test-driven development.</p> <p>Christopher shares an article on designing REST APIs and provides some of his own best practices. We cover authentication implementation, good naming conventions, versioned APIs, and ways to specify dates.</p> <p>We cover several other articles and projects from the Python community, including a news roundup, a PEP on removing dead batteries from the standard library, a comparison of the Python list vs tuple, a guide to writing user-friendly CLIs in Python, just enough Cython to be useful, a cross-platform TUI and ASCII animation package, and code for running <code>black</code> on Python code blocks in documentation files.</p> <div class="alert alert-primary" role="alert"> <p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/command-line-interfaces/">Command Line Interfaces in Python</a></p> <p>Command-line arguments are the key to converting your programs into useful and enticing tools that are ready to be used in the terminal of your operating system. In this course, you&rsquo;ll learn their origins, standards, and basics, and how to implement them in your program. </p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:02:23 &ndash; PEP 594: Removing Dead Batteries From the Standard Library</li> <li>00:05:33 &ndash; Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 Now Available </li> <li>00:08:37 &ndash; EuroPython 2022: Ticket Sales Open</li> <li>00:09:34 &ndash; Python list vs tuple Comparison</li> <li>00:12:19 &ndash; How to Write User-Friendly CLIs in Python</li> <li>00:20:14 &ndash; Sponsor: Anvil</li> <li>00:20:55 &ndash; Build a Hash Table in Python With TDD</li> <li>00:26:11 &ndash; Just Enough Cython to Be Useful</li> <li>00:36:21 &ndash; Video Course Spotlight</li> <li>00:37:45 &ndash; How to Design Better REST APIs</li> <li>00:47:10 &ndash; blacken-docs: Run black on Python Code Blocks within Documentation Files</li> <li>00:49:09 &ndash; asciimatics: Cross Platform TUI and ASCII Animation Package</li> <li>00:52:03 &ndash; Thanks and goodbye</li> </ul> <p>News:</p> <ul> <li><a href="https://peps.python.org/pep-0594/">PEP 594: Removing Dead Batteries From the Standard Library</a></li> <li><a href="https://pythoninsider.blogspot.com/2022/03/python-3103-3911-3813-and-3713-are-now.html">Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 Now Available</a></li> <li><a href="https://blog.europython.eu/europython-2022-ticket-sales-open-on-17-march/">EuroPython 2022: Ticket Sales Open</a></li> </ul> <p>Topic Links:</p> <ul> <li><a href="https://pub.towardsai.net/python-list-vs-tuple-an-in-depth-comparison-42c59348d8a8">Python list vs tuple Comparison</a> &ndash; Learn how <code>list</code> and <code>tuple</code> are similar and how they&rsquo;re different, including storage and speed differences and how to choose between them.</li> <li><a href="https://towardsdatascience.com/how-to-write-user-friendly-command-line-interfaces-in-python-cc3a6444af8e">How to Write User-Friendly CLIs in Python</a> &ndash; Learn how to write user-friendly command-line interface applications and an overview of several of the popular CLI libraries: <code>argparse</code>, <code>Click</code>, <code>Typer</code>, <code>Docopt</code>, and <code>Fire</code>.</li> <li><a href="https://realpython.com/python-hash-table/">Build a Hash Table in Python With TDD</a> &ndash; In this step-by-step tutorial, you&rsquo;ll implement the classic hash table data structure using Python. Along the way, you&rsquo;ll learn how to cope with various challenges such as hash code collisions while practicing test-driven development (TDD).</li> <li><a href="https://www.peterbaumgartner.com/blog/intro-to-just-enough-cython-to-be-useful/">Just Enough Cython to Be Useful</a> &ndash; Cython is a superset of Python designed to give C-like performance. Ever wanted to learn the basics? This article shows you how to get started.</li> <li><a href="https://r.bluethl.net/how-to-design-better-apis">How to Design Better REST APIs</a> &ndash; Fifteen language-agnostic tips on REST API design, including good naming conventions, ways to specify dates, versioned APIs, authentication keys, pagination, and when to use which HTTP methods.</li> </ul> <p>Projects:</p> <ul> <li><a href="https://github.com/asottile/blacken-docs">blacken-docs: Run black on Python Code Blocks in Documentation Files</a></li> <li><a href="https://github.com/peterbrittain/asciimatics">asciimatics: Cross Platform TUI and ASCII Animation Package</a></li> </ul> <p>Additional Links:</p> <ul> <li><a href="https://clig.dev/">Command Line Interface Guidelines - An Open-Source Guide</a></li> <li><a href="https://realpython.com/command-line-interfaces-python-argparse/">How to Build Command Line Interfaces in Python With argparse – Real Python</a></li> <li><a href="https://realpython.com/courses/command-line-interfaces/">Command Line Interfaces in Python – Real Python</a> </li> <li><a href="https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#types">Language Basics — Cython 3.0.0a10 documentation</a></li> <li><a href="https://realpython.com/courses/django-rest-framework/">Building HTTP APIs With Django REST Framework – Real Python</a></li> <li><a href="https://realpython.com/python-timer/#finding-bottlenecks-in-your-code-with-profilers">Python Timer Functions: Three Ways to Monitor Your Code – Real Python</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/lists-tuples-python/">Lists and Tuples in Python</a></li> <li><a href="https://realpython.com/courses/command-line-interfaces/">Command Line Interfaces in Python</a></li> <li><a href="https://realpython.com/courses/python-rock-paper-scissors-game/">Rock, Paper, Scissors With Python: A Command Line Game</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>