{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/22"},{"label":"Mathematics","url":"https://skillfed.io/packages/category/scientific-engineering-mathematics/3"},{"label":"Education","url":"https://skillfed.io/packages/category/education"}],"enrichment":{"capability":"Provides runtime-checkable protocols and type hints for working with numeric types beyond Python's built-in int and float, enabling type-safe interfaces that accept members of the numeric tower and other numeric primitives.","skillfed_tags":["numeric-typing","protocol-based","type-safety"],"use_cases":["Define a function that accepts any real number type and type-check it correctly without forcing callers to convert.","Build a numeric library that works with standard library numbers and third-party types, catching operator incompatibilities.","Compose custom protocols by mixing SupportsAbs, SupportsDivmod, and other operator protocols to express precise requirements.","Validate at runtime that an object truly supports the numeric operations your code needs, catching silent failures.","Document numeric interfaces for scientific or financial code where type distinctions matter for correctness."],"what_it_does":"numerary solves the problem of type-checking numeric interfaces that need to work with more than just int and float. Python's numeric tower and standard library types like Decimal and Fraction lack proper integration with the type system, leaving developers unable to write functions that accept arbitrary numeric types without breaking type-checking or resorting to overly broad annotations. numerary provides composable, runtime-checkable Protocol definitions\u2014such as RealLike, IntegralLike, SupportsIntegralOps, and SupportsAbs\u2014that let you declare numeric requirements precisely and have them work correctly with both type checkers and runtime isinstance checks.\n\nThe package is built on the Supports pattern from the standard library's typing module, extended with a caching protocol metaclass to handle edge cases where standard library types have inconsistent operator definitions. It targets developers writing numeric libraries, scientific code, or domain-specific interfaces that need to accept diverse numeric types while maintaining type safety. The single runtime dependency is beartype, and the package supports Python 3.8 through 3.11 on both CPython and PyPy.","worth_installing":"Yes. If you write numeric code or libraries that need to accept diverse numeric types while maintaining type safety, numerary solves a real gap in Python's type system. It has low install friction, active maintenance, no known vulnerabilities, and a permissive license. The trade-off is that it's still marked Beta and requires deliberate use of its protocols\u2014it won't magically fix existing code, but it will let you write new numeric interfaces correctly."},"id":"numerary","links":{"html":"https://skillfed.io/packages/numerary","md":"https://skillfed.io/packages/numerary.md","pypi":"https://pypi.org/project/numerary/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2023-08-03","license_spdx":null,"license_treatment":"permissive","name":"numerary","python_support":"supports_current","summary":"Python hacks for type-checking numbers"},"popularity":{"monthly_downloads":80333,"position":14298,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.4.4"}
