PyContractor
Introduction
Design by contract is a methodology of software design. It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as “contracts”, in accordance with a conceptual metaphor with the conditions and obligations of business contracts.
Usage
When using this library, just create a class and define the preconditions, postconditions or invariants in the method, or in a separate function.
For ex.
from PyContractor import PyContractor
def division(self, a, b):
PyContractor.require(b != 0, "Divisor must be non-zero")
division(2/0)
This tiny library just gives you a start to know this methodology and it’s mainly focused for educational purposes.
Metadata
Release files for PyContractor 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| PyContractor-0.1.1.tar.gz | 2.5 kB | Without provenance | Details |
Release files / PyContractor-0.1.1.tar.gz
| Download URL | PyContractor-0.1.1.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af8e8f463772f4f334c34a77c4b460f309a78ae000e09512970615d243f550c5
|
|
BLAKE2b-256 checksum How to use checksums |
5fa2ffec4d2c50a4bbe808dce5a13c94663575ee7d9872d51e9d4a0e39822884
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for PyContractor 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.