What principles should you consider when designing a Python library? How do you construct a library API that’s understandable and easy to use? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects.
We share an article about building library APIs. The piece provides advice for package structure, naming, error handling, and more. The author guides you toward Pythonic principles by comparing clunky vs elegant design examples.
Christopher discusses his recent video course on Jinja templating. The course covers creating text files with programmatic content and employing rich templates to structure the front end of Python web applications.
We cover several other articles and projects from the Python community, including several news updates, reasons why membership tests are fast for the range()
function, CLI tools hidden in the Python standard library, a thread about the right way to install Python, recipes for using the Polars library, and a project for feature flags within Django.
This week’s episode is brought to you by Snyk.
Course Spotlight: Jinja Templating
With Jinja, you can build rich templates that power the front end of your web applications. But you can use Jinja without a web framework running in the background. Anytime you want to create text files with programmatic content, Jinja can help you out.
Topics:
bdist_egg
Uploads to PyPIrange()
in Python?News:
bdist_egg
Uploads to PyPI – PEP 715 has been accepted and as of August 1, 2023, the .egg
format will no longer be accepted as an upload. Existing eggs on PyPI will remain in place.Show Links:
range()
in Python? – In Python, range()
is most commonly used in for
loops. However, ranges have some other use cases too, as they share many properties with lists. In this tutorial, you’ll explore why it’s so fast to perform a membership test on a Python range.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses: