$npx skillfedfor your agent

deal

**Deal** is a Python library for [design by contract][wiki] (DbC) programming.

With conditionsPyPI Software DevelopmentReleased Nov 202597.1K downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — deal-4.24.6-py3-none-any.whl
v4.24.6 · released 2025-11-30 · Python >=3.8

Yes, with conditions. Deal is worth installing if you want to add design-by-contract discipline to Python code and benefit from both runtime and static verification. The zero-dependency runtime, production track record since 2018, and integration with standard tools (pytest, flake8) make it low-risk to adopt. However, the aging maintenance status (257 days since last release) means you should verify that the version works with your Python version and toolchain before committing to it in a new project.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.8 or later.
  • Low install friction with no runtime dependencies.
  • The package is in production use since 2018 and has 903 repository stars, but maintenance status is aging—last release was 257 days ago.

License · maintenance · safety

permissive license (permissive) — Deal is permissively licensed, allowing use in both open-source and proprietary projects without significant legal constraints.

last release 2025-11-30 (257 days) · last repo commit 2025-11-30 · 903 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 97,100 downloads/mo, #13,168 on PyPI

Verify before relying

pip install deal

import deal

@deal.post(lambda result: result >= 0)
@deal.pure
def count(items, item):
    return items.count(item)

test_count = deal.cases(count)
  • Whether the 100% test coverage claim and partial formal verification are current as of version 4.24.6.
  • Performance characteristics and overhead of contract checking at runtime versus static analysis only.
  • Current state of integration with pytest, flake8, sphinx, and hypothesis in this version.
Same gist for agents: .md · .json

What it is and what it does

Deal is a design-by-contract library that lets you annotate Python functions with decorators to declare expected behavior: what inputs are valid (preconditions), what outputs must satisfy (postconditions), what invariants must hold, and what side-effects are allowed. Once annotated, the same contract declarations power multiple verification modes—runtime checking, static linting via flake8, property-based test generation, and formal verification—without requiring separate test code. The library has zero runtime dependencies, so you can add contracts during development and leave them enabled or disabled in production.

Deal integrates with pytest, flake8, sphinx, and hypothesis, and supports type annotations. It tracks exceptions and side-effects, detects memory leaks in pure functions, and performs partial execution to statically check possible values. The package has been in production use since 2018 and is actively maintained, though the last release was several months ago.

Use it for

  • Add precondition and postcondition decorators to functions to catch invalid inputs and outputs early in development.
  • Generate property-based tests automatically from contract decorators using deal.cases() integration.
  • Run static contract checking via flake8 or deal's built-in linter to find violations before runtime.
  • Enforce that functions are pure (no side-effects) and detect unexpected memory retention in pure functions.
  • Formally verify critical code paths to prove correctness for all possible inputs.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, with conditions.

Deal is worth installing if you want to add design-by-contract discipline to Python code and benefit from both runtime and static verification. The zero-dependency runtime, production track record since 2018, and integration with standard tools (pytest, flake8) make it low-risk to adopt. However, the aging maintenance status (257 days since last release) means you should verify that the version works with your Python version and toolchain before committing to it in a new project.

Install

deal on PyPI

Before you install

Low install friction with no runtime dependencies. The package is in production use since 2018 and has 903 repository stars, but maintenance status is aging—last release was 257 days ago.

Requires Python 3.8 or later.

License in practice

Deal is permissively licensed, allowing use in both open-source and proprietary projects without significant legal constraints.

Quickstart

pip install deal

import deal

@deal.post(lambda result: result >= 0)
@deal.pure
def count(items, item):
    return items.count(item)

test_count = deal.cases(count)

Verify before relying

  • Whether the 100% test coverage claim and partial formal verification are current as of version 4.24.6.
  • Performance characteristics and overhead of contract checking at runtime versus static analysis only.
  • Current state of integration with pytest, flake8, sphinx, and hypothesis in this version.

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.8
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceAging 257 days since the last release
Last repo commit
First released
Downloads97,100 / month, #13,168 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: PluginsIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: PythonTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance

Evidence: deal-4.24.6-py3-none-any.whl

Tags

Capabilities
design by contract decoratorsprecondition postcondition validationpython contract testingside-effect tracking libraryformal verification pythonproperty-based testing frameworkstatic contract checker
Topics
design-by-contractformal-verificationtesting-framework
PyPI keywords
dealcontractsprepostinvariantdecoratorsvalidationpythonicfunctional

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “design by contract decorators”

  • dealDeal is a Python library for design by contract that adds decorators…
  • icontracticontract enforces design-by-contract in Python through decorators…
  • zope.interfaceProvides a Python implementation of object interfaces for declaring…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also crosshair-tool · icontract · pact-python · python-interface · DafnyRuntimePython · zope.interface · eth-brownie · hypothesis · dvsim · datacontract-cli