{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/8"}],"enrichment":{"capability":"ensure provides literate assertion helpers for validating conditions in Python with readable error messages, usable in both tests and production code without relying on the assert statement.","skillfed_tags":["assertion-library","validation","bdd"],"use_cases":["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."],"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).\n\nThe 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.","worth_installing":"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\u2014the API is mature and the codebase is simple. Suitable for projects prioritizing readable validation code over framework integration."},"id":"ensure","links":{"html":"https://skillfed.io/packages/ensure","md":"https://skillfed.io/packages/ensure.md","pypi":"https://pypi.org/project/ensure/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2023-12-10","license_spdx":null,"license_treatment":"permissive","name":"ensure","python_support":"supports_current","summary":"Literate BDD assertions in Python with no magic"},"popularity":{"monthly_downloads":863431,"position":4868,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.0.4"}
