Comparison
assertpy vs dirty-equals vs expects vs PyHamcrest
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Fluent, fully typed assertion library for Python: your type checker sees only the assertions that fit the value, and every failure carries a structured diff. Soft assertions, polling, inline snapshots, OpenAPI contracts.
Actively maintained. Last release 2 weeks ago, commits in 26 of the last 26 weeks. A safe choice.
pip install assertpyDoing dirty (but extremely useful) things with equals.
Low maintenance activity. Last release 12 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install dirty-equalsExpressive and extensible TDD/BDD assertion library for Python
Likely abandoned. No release or commit for years (last release over 8 years ago).
pip install expectsHamcrest framework for matcher objects
Maintained. Last release over 3 years ago, commits in 9 of the last 26 weeks. Weaker on recent releases and release cadence.
pip install pyhamcrestIn short
- expects looks abandoned: avoid it for new projects.
- dirty-equals is the most used: 3.2M downloads a month.
- assertpy is better maintained: Pythie’s Index 74 against 24.
- assertpy is growing fastest: downloads +14% over the last month.
Side by side
| Metric | assertpy | dirty-equals | expects | PyHamcrest |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 74 | 24 |