skillfed

mypy-strict-kwargs

Enforce using keyword arguments where possible.

mypy-strict-kwargs v2026.7.19.1 150.7K downloads/30d#10,957 on PyPI6
Permissive license MIT License Copyright (c) 2024 Adam Dangoor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) Active released

What it is and what it does

mypy-strict-kwargs is a mypy plugin that enforces a code-style rule: all function calls must use keyword arguments rather than positional or mixed forms. When enabled, calling a function like `add(1, 2)` will trigger a type error; only `add(a=1, b=2)` is accepted. This is similar in spirit to code formatters like Black—it removes the need to debate call conventions and ensures consistency across a codebase.

The plugin is configured via mypy's standard configuration files (pyproject.toml, mypy.ini, or setup.cfg) and supports an ignore list for functions where keyword arguments are impractical (e.g., builtins like `str()`). It depends only on mypy and has low install friction. The maintainer is active, with recent releases supporting Python 3.11 through 3.14.

Use it for:

  • Enforce consistent call style across a team codebase to reduce code-review friction over positional vs. keyword arguments.
  • Improve error messages from mypy by ensuring named arguments, which report argument name rather than position in type mismatches.
  • Gradually migrate a legacy codebase toward keyword-only calls without manual refactoring by catching violations at type-check time.
  • Prevent accidental positional-argument bugs when function signatures change and arguments are reordered.
  • Standardize on a single call convention for functions with many parameters to improve readability.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A mypy plugin that enforces keyword-argument-only calls to functions, rejecting positional and mixed argument styles during type checking.

Yes, if your team values consistent call conventions and you already use mypy. Install friction is minimal, maintenance is active, and the plugin solves a real style problem without licensing friction. Not worth installing if you don't use mypy or if your codebase relies heavily on positional arguments to builtins or third-party libraries (though the ignore list mitigates this).

Install

mypy-strict-kwargs on PyPI

pip

pip install mypy-strict-kwargs

uv

uv add mypy-strict-kwargs

poetry

poetry add mypy-strict-kwargs

Installing mypy-strict-kwargs

Before you install

Low friction: pure Python wheel with only mypy as a runtime dependency. Actively maintained with a release 26 days ago; repo is not archived and supports Python 3.11–3.14.

License in practice

MIT License permits unrestricted use, modification, and distribution with minimal legal friction.

Quickstart

pip install mypy-strict-kwargs

# Add to pyproject.toml:
# [tool.mypy]
# plugins = ["mypy_strict_kwargs"]

# Then run mypy normally; it will reject add(1, 2) and require add(a=1, b=2)

Requires mypy to be installed and configured; Python 3.11 or later.

Verify before relying

  • Whether the plugin works with all mypy versions or has specific version constraints beyond what the fact sheet states.
  • Performance impact when enabled on large codebases.
  • Interaction with other mypy plugins or type-checking workflows.

Package facts

License MIT License Copyright (c) 2024 Adam Dangoor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 1 — mypy
Maintenance actively maintained — 26 days since the last release
Last repo commit
First released
Downloads 150,724/month — #10,957 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mypy_strict_kwargs-2026.7.19.1-py3-none-any.whl

Keywords: mypy

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentLicense :: OSI Approved :: MIT LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

mypy plugin keyword argumentsenforce named arguments mypystrict function call syntaxmypy code style enforcementpositional argument lintermypy call convention pluginkeyword-only function calls
mypy-plugincode-styletype-checking

More Quality Assurance packages