Latest / Developer tools

design-by-contract

github.com · Open source · Quiet

Python decorator for design-by-contract checks using lambda conditions

Visit github.com ↗Share

  • contracts
  • decorator
  • design by contract
  • python310
  • python design by contract
  • python decorator checks
  • precondition checks
  • lambda contracts
Stars
102
Forks
7
Open issues
0
Last commit
Releases
7
Found
4 years ago

GitHub figures as of . They are context, not a ranking.

design-by-contract is a small Python package that adds contract checks through a decorator, with conditions written as lambda expressions alongside type hints. It suits Python 3.10 and later users who want contract checks in their code.

Repository description on GitHub: “Handy decorator for elegant design-by-contract in 3.10+”

What it does

  • Contract checks added with a Python decorator
  • Conditions written as lambda expressions
  • Conditions sit alongside type annotations

Good for

  • Check preconditions and return values in Python functions
  • Write contract conditions alongside type hints
  • Learn newer Python features through a small package

Suits: Python 3.10+ developers who want contract checks.

Worth knowing: Values can be shared between conditions only to a limited extent

What you can try

Read the README on GitHub and install from source.

Install

pip install design-by-contract

Confirmed against the package registry. Read the project’s own instructions before running anything.

Links go to third-party sites KipFound does not control. KipFound has not installed, audited or tested this software.

Found vs. released

Kip first saw design-by-contract on , when stefanka posted it to Show HN. The oldest published release on GitHub is v0.1.0, dated . Its first tagged release came 5 days after it was found. 7 releases have been published in total; the latest is v0.3.1.1 ().

Day-7 and day-30 updates

Day 7 6 releases shipped

  • 6 releases in the first 7 days: v0.1.0 (17 Jul 2022), v0.1.1 (17 Jul 2022), v0.2 (17 Jul 2022), v0.2.1 (17 Jul 2022), v0.2.2 (17 Jul 2022), v0.3.0 (17 Jul 2022)
  • Show HN discussion at check time: 58 points, 12 comments. API record

Checked , later than day 7 because tracking began after.

Day 30 7 releases shipped

Checked , later than day 30 because tracking began after.

Release timeline every entry links to its source

  1. Repository created on GitHub: StefanUlbrich/design-by-contract
  2. Found: stefanka posted it to Show HN. Show HN
  3. Release v0.1.0
  4. Release v0.1.1
  5. Release v0.2
  6. Release v0.2.1
  7. Release v0.2.2
  8. Release v0.3.0
  9. Release v0.3.1.1
  10. Day-7 check recorded by Kip (details)
  11. Day-30 check recorded by Kip (details)

Quick answers

When was design-by-contract released?
Its first tagged release on GitHub is dated 17 Jul 2022. Kip found it on Show HN on 12 Jul 2022.
Is design-by-contract open source?
Its source is public on GitHub at StefanUlbrich/design-by-contract under the MIT licence.
What does design-by-contract run on?
Library.
Is design-by-contract free?
It is open source, so the code is free to read and run; check the licence for terms.
Is design-by-contract still maintained?
It has had no commit or release for over a year as of the latest check.

Provenance

SourceRecordLast checked
Show HNlisting
official API record
GitHub repositoryStefanUlbrich/design-by-contract
REST API record
GitHub Releasesrelease list
REST API record

Stable ID hn-32068447. Summary drafted with AI from the source records above and checked against KipFound’s rules before publishing. Dates and release facts come only from those records.

Share

Similar tools

More in Developer tools

Made this, or spotted a mistake? Ask for a correction or removal. No account or email address needed.