--- id: mo-kwargs version: "8.703.26061" license: MPL 2.0 license_treatment: copyleft maintenance: active --- # mo-kwargs — Object destructuring of function parameters for Python! License: copyleft · Maintenance: active · Downloads: 119.0K/mo ## What it is and what it does mo-kwargs is a decorator library that brings JavaScript-style object destructuring to Python function parameters. It provides an `@override` decorator that adds a `kwargs` parameter to decorated functions, allowing you to pass a dictionary of parameters that will be unpacked and merged with explicit arguments. Unlike `**kwargs`, this approach ignores extra keys in the dictionary instead of raising a TypeError, and allows explicit parameters to override values from the dictionary. The primary use case is handling parameter sets from external sources—configuration files, APIs, or dynamic data structures—where you cannot control whether extra keys are present. The decorator ensures required parameters are still enforced, optional parameters get their defaults, and all parameters (used or not) are available in the `kwargs` dict if the function accepts it. It works with regular Python functions, instance methods, and class methods. Use it for: - Load function parameters from a config file that may contain extra keys you don't need - Overlay multiple parameter dictionaries with explicit overrides (e.g., base config + user overrides) - Accept parameter bundles from external APIs without manually extracting each field - Collect all parameters passed to a function in a single dict for logging or inspection - Simplify function calls when parameters come from a dynamic source with unknown keys ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides an `@override` decorator that lets you pass function parameters as a dictionary via a `kwargs` argument, ignoring extra keys and allowing parameter overrides without raising errors. Yes, if you frequently work with parameter dictionaries from external sources and want to avoid boilerplate extraction or TypeError handling. The low install friction, active maintenance, and lack of security issues make it a safe choice. The MPL 2.0 copyleft license is a minor consideration only if you plan to modify and redistribute the package itself. ## Install pip install mo-kwargs uv add mo-kwargs poetry add mo-kwargs ## Installing mo-kwargs Before you install: Low friction: pure Python wheel with a single runtime dependency (mo-dots). Actively maintained as of March 2026, with a long release history since 2017. License in practice: MPL 2.0 is a copyleft license; you must disclose source and license any modifications to this package, though it permits commercial use and does not require derivative works to adopt the same license. Quickstart: from mo_kwargs import override @override def login(username, password=None): return f"Logged in as {username}" creds = {"username": "user", "password": "pass", "extra": "ignored"} result = login(kwargs=creds) Verify before relying: - Whether mo-dots adds meaningful install friction or is a lightweight utility dependency - Real-world performance impact of the decorator on function call overhead ## Package facts - License: MPL 2.0 (copyleft) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 119.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags function parameter destructuring, kwargs decorator python, pass dict as function arguments, object destructuring parameters, flexible function parameter binding, decorator, parameter-handling [View on SkillFed](https://skillfed.io/packages/mo-kwargs) · [View on PyPI](https://pypi.org/project/mo-kwargs/)