📅 Today’s Picks |
Build Dynamic Log Filters with Loguru Callables
Problem:
Logging is informative, but unnecessary logs can distract from the important ones. While you can filter by log level, sometimes you need to filter by some specific metric values.
Solution:
Loguru allows you to add a custom callable filter to your logger based on your specific criteria. This is significantly easier than setting up a custom filter class with standard logging.
Other features of Loguru:
- Beautiful logging output out of the box
- Significantly simpler to use than standard logging
- Rich exception tracebacks with variable values
Whenever: Python DateTime Done Right
Problem:
Standard library datetime arithmetic ignores Daylight Saving Time (DST) transitions, producing incorrect results.
Your time calculations can be off by an hour during DST changes.
Solution:
Whenever’s ZonedDateTime automatically accounts for Daylight Saving Time during time calculations.
Why use Whenever:
- Type-safe datetime operations prevent mixing errors
- DST transitions handled automatically (no surprises)
- Faster performance than standard library, Arrow and Pendulum
- Drop-in replacement for standard library
☕️ Weekly Finds |
ExtractThinker
LLM
Document Intelligence library for LLMs offering ORM-style interaction for flexible and powerful document workflows
pytest-mock
Python Utils
Thin-wrapper around the mock package for easier use with pytest
ecco
LLM
Explain, analyze, and visualize NLP language models with interactive visualizations for Transformer models