Show HN: A design-by-contract Python package in ~100 lines

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • design-by-contract

    Handy decorator for elegant design-by-contract in 3.10+

  • contracts

    PyContracts is a Python package that allows to declare constraints on function parameters and return values. Contracts can be specified using Python3 annotations, or inside a docstring. PyContracts supports a basic type system, variables binding, arithmetic constraints, and has several specialized contracts and an extension API. (by AndreaCensi)

  • Seems you refer to a domain specific language in the annotations. This is exactly what https://github.com/AndreaCensi/contracts does (it's an amazing project but has a very large code base). However, I wanted to achieve something similar in pure python and as compact as possible – so there are compromises (like no real symbolic calculus)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts