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 #308: Generate Time-Sortable IDs with Python 3.14’s UUID v7

Newsletter #308: Generate Time-Sortable IDs with Python 3.14’s UUID v7

Grab your coffee. Here are this week’s highlights.


📅 Today’s Picks

Generate Time-Sortable IDs with Python 3.14’s UUID v7

Code example: Generate Time-Sortable IDs with Python 3.14's UUID v7

Problem

UUID4 generates purely random identifiers that lack chronological ordering.

Without embedded timestamps, you need separate timestamp fields and custom sorting logic to organize records by creation time.

Solution

Python 3.14 introduces UUID version 7 with built-in timestamp ordering.

Key features:

  • Determine creation order by comparing two UUIDs directly
  • Retrieve exact creation time by extracting the embedded timestamp

Pyrefly: Automatic Type Inference for Python

Code example: Pyrefly: Automatic Type Inference for Python

Problem

By default, MyPy ignores untyped function bodies, forcing you to manually annotate variables and return types to get meaningful type checking.

This adds overhead and clutters your code with types that don’t add much value.

Solution

Pyrefly automatically infers return types and local variable types from usage, so you only annotate function parameters and public APIs where it matters.

Other features:

  • Lightning-fast type checking built in Rust
  • Works with VSCode, Neovim, Helix, Emacs, and Zed
  • Recognizes dataclass transforms from attrs, Pydantic, and similar libraries

☕️ Weekly Finds

pyrsistent [Python Utils] – Persistent/Immutable/Functional data structures for Python

wrapt [Python Utils] – A Python module for decorators, wrappers and monkey patching

Shiny for Python [Dashboard] – Build fast, beautiful reactive web applications in Python

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 *

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran