|
Description:
|
|
Topics covered in this episode:
Watch on YouTube
About the show
Sponsored by Sentry: pythonbytes.fm/sentry
Connect with the hosts
Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.
Brian #1: Make Each Line Count, Keeping Things Simple in Python
- Bob Belderbos
- Some great tips to help you simplify your Python code to make it more understandable and maintainable.
Michael #2: Parsel
- Parsel is a BSD-licensed Python library to extract data from HTML, JSON, and XML documents.
- Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors.
- It supports:
Brian #3: A Comprehensive Guide to Python Logging with Structlog
- Stanley Ulili
- structlog is an awesome logging tool, and already has great documentation.
- However, this article is a great starting point, highlighting:
- how easy it is to get started using structlog
- configuring the default log level
- changing the formatting
- customizing the time stamp
- adding custom fields
- adding contextual data
- filtering
- async
- …
Michael #4: Stamina
- via Matthias Bach, by Hynek
- Production-grade Retries Made Easy
- stamina is an opinionated wrapper around the great-but-unopinionated Tenacity package. Its goal is to be as ergonomic as possible, while doing the right thing by default, while minimizing potential for misuse.
- General additions on top of Tenacity
- Retry only on certain exceptions.
- Exponential backoff with jitter between retries.
- Limit the number of retries and total time.
- Automatic async support.
- Preserve type hints of the decorated callable.
- Count (Prometheus) and log (structlog) retries with basic metadata, if they’re installed.
- Easy global deactivation for testing.
Extras
Brian:
Michael:
Joke:
|