Icontract: Design-by-Contract for Python

JSON →
library 2.7.3 ·python
verified May 24, 2026

icontract provides design-by-contract for Python, allowing developers to define preconditions, postconditions, and invariants for functions and classes using expressive lambda functions. It helps ensure correctness and provides informative violation messages, failing fast when contracts are broken. The current version is 2.7.3, and it maintains a steady release cadence with frequent patch updates addressing bugs and adding support for newer Python versions.

total hits 16
actors 6 distinct systems
last hit 2d ago Bingbot
MetaBot
4
GPTBot
2
Script
2
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇮 Finland · 🇫🇷 France