Registry / testing / strict-kwargs

strict-kwargs

JSON →
library2026.6.4pypypiunverified

A Python library for enforcing keyword-only arguments in function signatures. Version 2026.6.4 requires Python 3.11+. It provides a decorator that forces all arguments after a certain point to be passed as keyword arguments, reducing bugs from positional argument misuse. No breaking changes have been reported recently.

pip install strict-kwargs
INSTALL
IMPORT
SIG · STRICT-KWARGS
S
strict-kwargs
testingpythonv2026.6.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

strict_kwargs
from strict_kwargs import strict_kwargs
from strict_kwargs import strict_kwargs

Decorate a function with @strict_kwargs to require all arguments to be passed as keyword arguments.

from strict_kwargs import strict_kwargs @strict_kwargs def greet(name, greeting): return f"{greeting}, {name}!" # Correct call print(greet(name="Alice", greeting="Hello")) # Wrong call (will raise TypeError) # print(greet("Alice", "Hello"))
Debug
Known issues
breakingThe decorator enforces keyword-only arguments; any positional usage raises TypeError in all known versions.
fix
Always use keyword arguments when calling a decorated function.
affects: >=0.1.0
gotchaApplying @strict_kwargs to a class method will not affect self or cls; they are handled separately.
fix
self or cls can still be passed positionally; all other arguments become keyword-only.
affects: >=0.1.0
gotchaIf you decorate a function with **kwargs, the decorator does not affect those; they are already keyword-only by Python syntax.
fix
Use the decorator only to enforce keyword usage for other parameters.
affects: >=0.1.0
Upgrade
Version history
2026.6.4latest on PyPI · released Jun 4, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
strict-kwargs — pip install strict-kwargs · libregistry