samuelcolvin/dirty-equals
Some data may be outdated — see provenance labels.
Doing dirty (but extremely useful) things with equals. observed · 2026-09-28
Health v2 · maintenance only
69/100
- Activity 88
- Release rhythm 26
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-22. Adoption (stars, forks) is never an input.
- gap_med: 154.0
- age_days: 1729
- days_rel: 339
- days_push: 72
- n_releases_24m: 3
Adoption not part of the score
1007 stars · 56 forks observed · 2026-09-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
dirty-equals is a Python library that overloads __eq__ to provide declarative, partial-match assertion helpers for unit tests. It lets you compare values against matchers like IsPositiveInt, IsStr(regex=...), IsJson, and IsNow instead of exact values.
Use cases
- assert API response fields without knowing exact values
- test database row contents declaratively
- match strings against regexes in assertions
- compare JSON strings by decoded value
- check datetimes are close to now in tests
- partially match dicts and lists in pytest
When to choose
- writing pytest unit tests that assert on API responses or DB rows
- you want readable, declarative assertions with partial matching
- you need regex, type, or fuzzy datetime comparisons inside assert statements
When to avoid
- non-Python projects
- production code where magic __eq__ semantics would be confusing
- tests requiring strict exact-value equality only
Facets
library · maturity active
testing developer-tools testing developer-tools python cross-platform pytest unit-testing assertions declarative-tests matchers
3 sources
- readme: https://github.com/samuelcolvin/dirty-equals · fetched 2026-09-28 · e08357dbf42b
- homepage: https://dirty-equals.helpmanual.io · fetched 2026-08-29 · d78d824cb680
- registry_pypi: https://pypi.org/pypi/dirty-equals/json · fetched 2026-08-29 · 06efabf39edf
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| samuelcolvin/dirty-equals | main | 69 |
For agents
markdown · JSON · MCP: product_card(name="samuelcolvin/dirty-equals")
Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem