---
title: "Programmatically comparing Python version strings"
url: https://daily.dev/posts/programmatically-comparing-python-version-strings-ou72erhqw
source_url: https://til.simonwillison.net/python/comparing-version-numbers
type: article
source: "Simon Willison"
published: 2024-03-17T21:35:04.101Z
updated: 2024-05-09T09:28:05.588Z
tags: ["python", "datasette"]
reading_time: 3
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Programmatically comparing Python version strings

**[Simon Willison](https://daily.dev/sources/simonwillison)** · 3 min read · 0 upvotes · 0 comments

## Summary

Learn how to compare version strings in Python programmatically using the packaging.version package. See an example of how to use it to mark a pytest test as skipped based on the version of Datasette.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://til.simonwillison.net/python/comparing-version-numbers>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#datasette](https://daily.dev/tags/datasette)

[View this post on daily.dev](https://daily.dev/posts/programmatically-comparing-python-version-strings-ou72erhqw)
