$npx skillfedfor your agent

PyHamcrest

Hamcrest framework for matcher objects

Worth itPyPI Software DevelopmentReleased Oct 20236.4M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pyhamcrest-2.1.0-py3-none-any.whl
v2.1.0 · released 2023-10-22 · Python >=3.6

Yes. PyHamcrest is stable (Production/Stable status), widely used (6393524 monthly downloads), has no dependencies, and carries a permissive BSD License. The aging maintenance status (last release 2023-10-22) is not a blocker for a mature, focused library—it indicates stability rather than abandonment. Install it if you want more readable, maintainable test assertions.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Low install friction with no runtime dependencies.
  • Maintenance status is aging—last release was 2023-10-22 and last commit 2026-02-12, but the repository remains active and not archived.

License · maintenance · safety

permissive license (permissive) — BSD License (permissive). You can use, modify, and distribute PyHamcrest freely in commercial and private projects, provided you retain the copyright notice and disclaimer.

last release 2023-10-22 (1027 days) · last repo commit 2026-02-12 · 804 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 6,393,524 downloads/mo, #1,916 on PyPI

Verify before relying

pip install PyHamcrest

from PyHamcrest import assert_that, equal_to
import unittest

class MyTest(unittest.TestCase):
    def test_example(self):
        assert_that(5, equal_to(5))
  • Whether the import path is 'hamcrest' or 'PyHamcrest' in current versions
Same gist for agents: .md · .json

What it is and what it does

PyHamcrest is a matcher framework that lets you write test assertions as declarative rules rather than imperative comparisons. Instead of writing brittle equality checks, you compose matchers to express exactly what aspect of an object you're testing and to what precision. This helps tests stay readable and maintainable: they fail when behavior deviates from expectations but pass through minor, unrelated changes.

The library comes with matchers for objects, numbers, text, sequences, dictionaries, and logical combinations. You can also write custom matchers by subclassing BaseMatcher. PyHamcrest integrates naturally with unittest and other test frameworks. It has no runtime dependencies and supports Python 3.6 and later across CPython, PyPy, and Jython.

Use it for

  • Write unit tests with readable, composable assertions that fail precisely when behavior changes.
  • Validate UI or form input by matching against patterns for strings and regular expressions.
  • Filter or validate data structures using reusable matcher logic across multiple test cases.
  • Create custom matchers for domain-specific validation rules to eliminate test code duplication.
  • Build flexible test suites that distinguish between critical behavior changes and minor implementation details.

Worth the install?

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

Worth it

Yes.

PyHamcrest is stable (Production/Stable status), widely used (6393524 monthly downloads), has no dependencies, and carries a permissive BSD License. The aging maintenance status (last release 2023-10-22) is not a blocker for a mature, focused library—it indicates stability rather than abandonment. Install it if you want more readable, maintainable test assertions.

Install

pyhamcrest on PyPI

Before you install

Low install friction with no runtime dependencies. Maintenance status is aging—last release was 2023-10-22 and last commit 2026-02-12, but the repository remains active and not archived.

License in practice

BSD License (permissive). You can use, modify, and distribute PyHamcrest freely in commercial and private projects, provided you retain the copyright notice and disclaimer.

Quickstart

pip install PyHamcrest

from PyHamcrest import assert_that, equal_to
import unittest

class MyTest(unittest.TestCase):
    def test_example(self):
        assert_that(5, equal_to(5))

Verify before relying

  • Whether the import path is 'hamcrest' or 'PyHamcrest' in current versions

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.6
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceAging 1,027 days since the last release
Last repo commit
First released
Downloads6,393,524 / month, #1,916 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: JythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software DevelopmentTopic :: Software Development :: Quality AssuranceTopic :: Software Development :: Testing

Evidence: pyhamcrest-2.1.0-py3-none-any.whl

Tags

Capabilities
matcher framework for testingflexible test assertionshamcrest matchers pythonreadable unit test assertionscomposable test matchersdata validation matcherstest assertion library
Topics
testingmatchersassertions
PyPI keywords
hamcrestmatcherspyunittesttestingunitunittestunittesting

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 › “matcher framework for testing”

  • PyHamcrestPyHamcrest provides a framework for writing declarative matcher…
  • expectsExpects is an assertion library for TDD/BDD that lets you write test…
  • libsastlibsast is a static application security testing library that scans…

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

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also anys · dirty-equals · assertpy · surer · re-assert · callee · testtools · robotframework-assertion-engine · asserts · expects