deal

🤝 Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.

https://github.com/life4/deal

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.4%) to scientific vocabulary

Keywords

contracts contracts-programming dbc deal decorators design-by-contract flake8 functional-programming hacktoberfest interface invariant linter mypy property-based-testing python pythonic refinement-types testing typing validation

Keywords from Contributors

fuzzing
Last synced: 6 months ago · JSON representation

Repository

🤝 Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.

Basic Info
Statistics
  • Stars: 826
  • Watchers: 13
  • Forks: 33
  • Open Issues: 5
  • Releases: 44
Topics
contracts contracts-programming dbc deal decorators design-by-contract flake8 functional-programming hacktoberfest interface invariant linter mypy property-based-testing python pythonic refinement-types testing typing validation
Created about 8 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

Deal

Build Status PyPI version Development Status

A Python library for design by contract (DbC) and checking values, exceptions, and side-effects. In a nutshell, deal empowers you to write bug-free code. By adding a few decorators to your code, you get for free tests, static analysis, formal verification, and much more. Read intro to get started.

Features

Deal in 30 seconds

```python

the result is always non-negative

@deal.post(lambda result: result >= 0)

the function has no side-effects

@deal.pure def count(items: List[str], item: str) -> int: return items.count(item)

generate test function

test_count = deal.cases(count) ```

Now we can:

  • Run python3 -m deal lint or flake8 to statically check errors.
  • Run python3 -m deal test or pytest to generate and run tests.
  • Just use the function in the project and check errors in runtime.

Read more in the documentation.

Installation

bash python3 -m pip install --user 'deal[all]'

Contributing

Contributions are welcome! A few ideas what you can contribute:

  • Add new checks for the linter.
  • Improve documentation.
  • Add more tests.
  • Improve performance.
  • Found a bug? Fix it!
  • Made an article about deal? Great! Let's add it into the README.md.
  • Don't have time to code? No worries! Just tell your friends and subscribers about the project. More users -> more contributors -> more cool features.

To run tests locally, all you need is task. Run task all to run all code formatters, linters, and tests.

Thank you :heart:

Owner

  • Name: Life4
  • Login: life4
  • Kind: organization

Big and cool projects by @orsinium. See also @orsinium-labs.

GitHub Events

Total
  • Release event: 1
  • Watch event: 75
  • Delete event: 2
  • Issue comment event: 16
  • Push event: 12
  • Pull request review event: 6
  • Pull request review comment event: 6
  • Pull request event: 11
  • Fork event: 6
  • Create event: 2
Last Year
  • Release event: 1
  • Watch event: 75
  • Delete event: 2
  • Issue comment event: 16
  • Push event: 12
  • Pull request review event: 6
  • Pull request review comment event: 6
  • Pull request event: 11
  • Fork event: 6
  • Create event: 2

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 1,145
  • Total Committers: 19
  • Avg Commits per committer: 60.263
  • Development Distribution Score (DDS): 0.04
Past Year
  • Commits: 16
  • Committers: 4
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.25
Top Committers
Name Email Commits
Gram m****s@m****u 1,099
Ryan Delaney r****y@p****m 14
sobolevn m****l@s****e 6
Ryan Delaney r****b@p****m 5
Max Caldwell m****x@s****i 3
aleien a****n@y****u 3
Isidro Arias i****s@h****s 2
Ryan Delaney r****t@p****m 2
Devon Richards f****n@g****m 1
Jacob Sánchez j****z@p****m 1
Spencer Williams s****i@g****m 1
Vishal Sodani v****i@r****m 1
Waleed Mebane 5****e 1
jgberry j****e@g****m 1
Sergey Sokolov d****7@y****u 1
Panashe M. Fundira p****e@d****m 1
toonarmycaptain t****n@h****m 1
Иннокентий Садыков i****5@g****m 1
Luis Durão k****x@m****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 113
  • Average time to close issues: N/A
  • Average time to close pull requests: 9 days
  • Total issue authors: 0
  • Total pull request authors: 18
  • Average comments per issue: 0
  • Average comments per pull request: 1.14
  • Merged pull requests: 107
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 12 days
  • Issue authors: 0
  • Pull request authors: 4
  • Average comments per issue: 0
  • Average comments per pull request: 3.5
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • orsinium (90)
  • rpdelaney (8)
  • maxtheman (4)
  • TheDSCPL (2)
  • isidroas (2)
  • qnbhd (2)
  • sobolevn (2)
  • FedericoCeratto (2)
  • toonarmycaptain (1)
  • dutyrok (1)
  • vishalsodani (1)
  • ruler501 (1)
  • aleien (1)
  • waleedmebane (1)
  • munyari (1)
Top Labels
Issue Labels
Pull Request Labels
hacktoberfest-accepted (6)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 43,587 last-month
  • Total docker downloads: 197
  • Total dependent packages: 9
  • Total dependent repositories: 28
  • Total versions: 67
  • Total maintainers: 2
pypi.org: deal

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

  • Versions: 67
  • Dependent Packages: 9
  • Dependent Repositories: 28
  • Downloads: 43,587 Last month
  • Docker Downloads: 197
Rankings
Dependent packages count: 1.3%
Downloads: 2.4%
Stargazers count: 2.5%
Dependent repos count: 2.7%
Average: 3.4%
Docker downloads count: 3.6%
Forks count: 8.1%
Maintainers (2)
Last synced: 6 months ago