Provide design-by-contract with informative violation messages.
Project description
icontract
icontract provides design-by-contract to Python3 with informative violation messages and inheritance.
It also gives a base for a flourishing of a wider ecosystem:
A linter pyicontract-lint,
A sphinx plug-in sphinx-icontract,
A tool icontract-hypothesis for automated testing and ghostwriting test files which infers Hypothesis strategies based on the contracts,
together with IDE integrations such as icontract-hypothesis-vim, icontract-hypothesis-pycharm, and icontract-hypothesis-vscode,
Directly integrated into CrossHair, a tool for automatic verification of Python programs,
together with IDE integrations such as crosshair-pycharm and crosshair-vscode, and
An integration with FastAPI through fastapi-icontract to enforce contracts on your HTTP API and display them in OpenAPI 3 schema and Swagger UI, and
An extensive corpus, Python-by-contract corpus, of Python programs annotated with contracts for educational, testing and research purposes.
Installation
Install icontract with pip:
pip3 install icontract
Versioning
We follow Semantic Versioning. The version X.Y.Z indicates:
X is the major version (backward-incompatible),
Y is the minor version (backward-compatible), and
Z is the patch version (backward-compatible bug fix).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file icontract-2.7.1.tar.gz
.
File metadata
- Download URL: icontract-2.7.1.tar.gz
- Upload date:
- Size: 64.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e8196754743bd1a3659d66da2ddf1dc0950d01e535c2933bd997b02c6412a03 |
|
MD5 | d2138fbb31806d0870f87080abdbfe7c |
|
BLAKE2b-256 | 3dd93c2a6656faf40ce30ead1bffbcf413db6aa5695dcd9a187eca291cc027d9 |
File details
Details for the file icontract-2.7.1-py3-none-any.whl
.
File metadata
- Download URL: icontract-2.7.1-py3-none-any.whl
- Upload date:
- Size: 39.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aac4073aebb117f16dcb73b8496209a247fc6b153f203a0648d1065ff8bb81af |
|
MD5 | 50cafd07b6e88c5cec93cae58cb9b280 |
|
BLAKE2b-256 | ae1126fcfa5ef974447521194a1298bff77b029f6d0e6e27587faefb5b68c398 |