$npx skillfedfor your agent

dirty-equals

Doing dirty (but extremely useful) things with equals.

Worth itPyPI Python ModulesReleased Nov 20253.0M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — dirty_equals-0.11-py3-none-any.whl
v0.11 · released 2025-11-17 · Python >=3.9

Yes. dirty-equals is a low-friction, actively maintained testing utility with no dependencies that directly improves test readability and reduces boilerplate in assertion-heavy codebases. It is especially valuable for API and database testing where exact values are unknown or irrelevant. MIT license and broad Python version support make it safe to adopt.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.9 or later.
  • Low friction—pure Python wheel with no runtime dependencies.
  • Actively maintained with recent releases and steady community adoption (top 5000 PyPI packages).

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.

last release 2025-11-17 (270 days) · last repo commit 2026-08-10 · 1,004 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,952,300 downloads/mo, #2,808 on PyPI

Verify before relying

pip install dirty-equals

from dirty_equals import IsPositiveInt, IsStr, IsJson

assert user_data == {
    'id': IsPositiveInt,
    'avatar_file': IsStr(regex=r'/[a-z0-9\-]{10}/example\.png'),
    'settings_json': IsJson({'theme': 'dark'}),
}
  • Whether performance overhead of custom equality checks is acceptable for large test suites.
  • Compatibility with test frameworks beyond pytest (unittest, nose2, etc.).
Same gist for agents: .md · .json

What it is and what it does

dirty-equals is a testing library that overloads Python's `__eq__` method to create reusable matcher objects for assertions. Instead of manually checking individual fields or modifying data before comparison, you write assertions that read like specifications: a field must be a positive integer, match a regex, contain specific JSON, or fall within a time window. This makes test code more declarative and maintainable, especially when validating API responses or database records with many fields.

The library provides matchers for common patterns (type checks, regex matching, partial collections, JSON parsing, timestamp proximity) and supports combining conditions with boolean operators. It has no runtime dependencies, installs cleanly as a pure Python wheel, and is actively maintained with support for Python 3.9 through 3.14.

Use it for

  • Validate API response payloads without hardcoding exact values you don't control (timestamps, IDs, file paths).
  • Compare database query results where you only care about certain fields or partial structure matches.
  • Write readable assertions for JSON data by comparing the parsed structure rather than string matching.
  • Test that response fields are the correct type without brittle exact-value checks.
  • Combine multiple validation rules (e.g., 'must be a string AND match this pattern') in a single assertion.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

dirty-equals is a low-friction, actively maintained testing utility with no dependencies that directly improves test readability and reduces boilerplate in assertion-heavy codebases. It is especially valuable for API and database testing where exact values are unknown or irrelevant. MIT license and broad Python version support make it safe to adopt.

Install

dirty-equals on PyPI

Before you install

Low friction—pure Python wheel with no runtime dependencies. Actively maintained with recent releases and steady community adoption (top 5000 PyPI packages).

Requires Python 3.9 or later.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.

Quickstart

pip install dirty-equals

from dirty_equals import IsPositiveInt, IsStr, IsJson

assert user_data == {
    'id': IsPositiveInt,
    'avatar_file': IsStr(regex=r'/[a-z0-9\-]{10}/example\.png'),
    'settings_json': IsJson({'theme': 'dark'}),
}

Verify before relying

  • Whether performance overhead of custom equality checks is acceptable for large test suites.
  • Compatibility with test frameworks beyond pytest (unittest, nose2, etc.).

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 270 days since the last release
Last repo commit
First released
Downloads2,952,300 / month, #2,808 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: ConsoleEnvironment :: MacOS XFramework :: PytestIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: InternetTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Evidence: dirty_equals-0.11-py3-none-any.whl

Tags

Capabilities
flexible test assertionsdeclarative equality matchingapi response testingpartial dict comparisonunit test helpersjson assertion testingdatabase result validation
Topics
test-assertionapi-testingdeclarative

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “declarative equality matching”

  • dirty-equalsProvides custom equality matchers that make unit test assertions more…
  • anysProvides matcher objects that compare equal to values meeting…
  • attrsattrs is a Python library that automatically generates common class…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also re-assert · pytest-unordered · pyspark-test · PyHamcrest · testfixtures · jsoncomparison · assertpy · recursive-diff · django-dirtyfields · anys