mypy-strict-kwargs
Enforce using keyword arguments where possible.
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-kwargsuv
uv add mypy-strict-kwargspoetry
poetry add mypy-strict-kwargsInstalling 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
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
strict-kwargsA standalone CLI linter that enforces keyword…
permissive · top 15,000 on PyPI
pytest-mypy-pluginsA pytest plugin that runs type-checking tests…
permissive · top 15,000 on PyPI
flake8-logging-formatA flake8 extension that enforces logging best…
permissive · top 15,000 on PyPI
classesImplements typeclasses for Python, enabling…
permissive · top 15,000 on PyPI
coverage-conditional-pluginA coverage.py plugin that applies conditional…
permissive · top 15,000 on PyPI
flake8-blackA flake8 plugin that runs black's code style…
permissive · top 15,000 on PyPI
pytypePytype is a static type checker that infers…
permissive · top 5,000 on PyPI
docsigLints Python function and method signatures to…
permissive · top 15,000 on PyPI
wemake-python-styleguideA flake8 plugin that enforces strict,…
permissive · top 15,000 on PyPI
django-stubsProvides type stubs and a mypy plugin to enable…
permissive · top 5,000 on PyPI