Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
About Article
Analyze Data
Archive
Best Practices
Better Outputs
Blog
Code Optimization
Code Quality
Command Line
Course
Daily tips
Dashboard
Data Analysis & Manipulation
Data Engineer
Data Visualization
DataFrame
Delta Lake
DevOps
DuckDB
Environment Management
Feature Engineer
Git
Jupyter Notebook
LLM
LLM Tools
Machine Learning
Machine Learning & AI
Machine Learning Tools
Manage Data
MLOps
Natural Language Processing
Newsletter Archive
NumPy
Pandas
Polars
PySpark
Python Helpers
Python Tips
Python Utilities
Scrape Data
SQL
Testing
Time Series
Tools
Visualization
Visualization & Reporting
Workflow & Automation
Workflow Automation

Newsletter #217: Whenever: Python DateTime Done Right

Newsletter #217: Whenever: Python DateTime Done Right


🤝 COLLABORATION

Get Apache Airflow® 3 certified (for free)

Get Apache Airflow® 3 certified (for free)

On September 16, Beyond Analytics kicks off with a live Airflow 3 Certification Crash Course, where you can ask questions and prepare for the Airflow 3 certification exam.

Join “Data with Marc’s” creator Marc Lamberti for a live session where you will:

  • Learn about the Airflow 3 features that will be covered in the exam, such as scheduling, DAG versioning, and backfills
  • Get your certification questions answered live
  • Receive a $150 voucher for the official Airflow 3 certification exam

Register here


📅 Today’s Picks

Build Dynamic Log Filters with Loguru Callables

Code example: 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

Code example: 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

Looking for a specific tool? Explore 70+ Python tools →

Stay Current with CodeCut

Actionable Python tips, curated for busy data pros. Skim in under 2 minutes, three times a week.

Leave a Comment

Your email address will not be published. Required fields are marked *

0
    0
    Your Cart
    Your cart is empty
    Scroll to Top

    Work with Khuyen Tran

    Work with Khuyen Tran