$npx skillfedfor your agent

ensure

Literate BDD assertions in Python with no magic

With conditionsPyPI Python ModulesReleased Dec 2023863.4K downloads / moApache Software LicensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — ensure-1.0.4-py3-none-any.whl
v1.0.4 · released 2023-12-10 · Python >=3.6 · 1 runtime deps: six

Yes, if you want readable assertions in tests or production validation. The library is stable, has no known vulnerabilities, and adds minimal install friction. The dormant maintenance (no updates since late 2023) is a minor concern but not a blocker—the API is mature and the codebase is simple. Suitable for projects prioritizing readable validation code over framework integration.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.6 or later; function annotation enforcement via @ensure_annotations decorator requires Python 3.
  • Low friction install with a single lightweight dependency (six).
  • Dormant maintenance status since late 2023, though the repository remains active and the package is marked Production/Stable.

License · maintenance · safety

Apache Software License (permissive) — Licensed under Apache Software License (permissive), allowing use in commercial and proprietary projects with minimal restrictions.

last release 2023-12-10 (978 days) · last repo commit 2024-12-03 · 157 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 863,431 downloads/mo, #4,868 on PyPI

Verify before relying

pip install ensure

from ensure import ensure

ensure(1).is_an(int)
ensure({1: 2}).has_key(1).whose_value.equals(2)
ensure([1, 2, 3]).is_sorted()
  • Whether dormant maintenance status affects real-world reliability or compatibility with current Python versions beyond 3.11.
  • Performance characteristics compared to other assertion libraries in production validation scenarios.
Same gist for agents: .md · .json

What it is and what it does

ensure is a standalone assertion library that lets you write validation checks using a fluent, readable API inspired by JavaScript testing frameworks. Instead of cryptic assert statements or unittest methods, you chain readable clauses like `.is_an(int)`, `.contains()`, and `.has_key()` to express what you expect. The library raises informative EnsureError exceptions with clear messages when checks fail, making it useful for both test code and production validation (e.g., API input checking).

The package depends only on six and installs as a pure Python wheel. It supports Python 3.6 through 3.11 and includes a decorator, @ensure_annotations, for enforcing function signature type hints at runtime. Because ensure doesn't use the assert statement (which can be disabled with Python's -O flag), validations remain active in optimized production deployments.

Use it for

  • Validate API request parameters with readable error messages for client feedback.
  • Write BDD-style test assertions that read like English sentences.
  • Enforce function argument types at runtime using @ensure_annotations decorator.
  • Chain multiple conditions on complex data structures (dicts, lists, sets) with fluent syntax.
  • Validate data structure shape and contents in production code without test framework overhead.

Worth the install?

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

With conditions

Yes, if you want readable assertions in tests or production validation.

The library is stable, has no known vulnerabilities, and adds minimal install friction. The dormant maintenance (no updates since late 2023) is a minor concern but not a blocker—the API is mature and the codebase is simple. Suitable for projects prioritizing readable validation code over framework integration.

Install

ensure on PyPI

Before you install

Low friction install with a single lightweight dependency (six). Dormant maintenance status since late 2023, though the repository remains active and the package is marked Production/Stable.

Requires Python 3.6 or later; function annotation enforcement via @ensure_annotations decorator requires Python 3.

License in practice

Licensed under Apache Software License (permissive), allowing use in commercial and proprietary projects with minimal restrictions.

Quickstart

pip install ensure

from ensure import ensure

ensure(1).is_an(int)
ensure({1: 2}).has_key(1).whose_value.equals(2)
ensure([1, 2, 3]).is_sorted()

Verify before relying

  • Whether dormant maintenance status affects real-world reliability or compatibility with current Python versions beyond 3.11.
  • Performance characteristics compared to other assertion libraries in production validation scenarios.

Package facts

LicenseApache Software License permissive
Python supportSupports the current Python release >=3.6
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
six
MaintenanceDormant 978 days since the last release
Last repo commit
First released
Downloads863,431 / month, #4,868 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: MacOS :: MacOS XOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python Modules

Evidence: ensure-1.0.4-py3-none-any.whl

Tags

Capabilities
readable assertions pythonliterate bdd assertionsvalidation helpers pythonexpressive condition checkingassertion library no magicruntime type validationchainable assertions
Topics
assertion-libraryvalidationbdd

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 › “literate bdd assertions”

  • ensureensure provides literate assertion helpers for validating conditions…
  • expectsExpects is an assertion library for TDD/BDD that lets you write test…
  • pytest-bddpytest-bdd implements Gherkin-based behavior-driven development…

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 sure · assertpy · expects · surer · asserts · re-assert · robotframework-assertion-engine · pytest-assume · delayed-assert · PyHamcrest