kubernetes-typed
Collection of mypy plugins and stubs for kubernetes
What it is and what it does
kubernetes-typed is a mypy plugin that generates type definitions for Kubernetes objects at static analysis time. It works in two modes: it can type-check custom resource definitions by reading their YAML schemas and generating TypedDict types, or it can provide type stubs for the kubernetes-client library to enable type checking of standard Kubernetes objects. The plugin integrates directly into mypy's type-checking pipeline, allowing developers to catch type errors in Kubernetes manifests and client code before runtime.
The package depends on mypy, jsonschema, PyYAML, mypy-extensions, and jsonschema-typed-v2. It supports Python 3.8 through 3.12 and follows the kubernetes-client versioning scheme, so the MAJOR.MINOR version matches the client version for which stubs were generated. It is currently in beta and dormant—no active development is expected, though the repository is not archived.
Use it for:
- Type-check custom resource definitions in YAML files to catch schema violations early in development
- Enable IDE autocomplete and type hints when working with kubernetes-client library classes
- Validate Kubernetes manifest dictionaries before submitting them to the API
- Catch typos and incorrect field names in Pod, Deployment, and other standard resource specs
- Enforce consistent typing across a team's Kubernetes automation and operator code
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A mypy plugin that adds type checking support for Kubernetes objects, including custom resource definitions and the kubernetes-client library.
Yes, if you use mypy for Python Kubernetes tooling and want type safety for manifests and client code. The low install friction and permissive license make it a straightforward addition to a mypy workflow. However, dormant maintenance and known limitations mean it is best suited for stable, non-bleeding-edge use cases. No known security vulnerabilities.
Install
kubernetes-typed on PyPI
pip
pip install kubernetes-typeduv
uv add kubernetes-typedpoetry
poetry add kubernetes-typedInstalling kubernetes-typed
Before you install
Low install friction with a pure-wheel distribution. Maintenance is dormant—last release was 711 days ago, though the repository remains active with a recent commit on 2024-09-08. Suitable for stable use but expect no active development.
License in practice
Apache License Version 2.0 is permissive, allowing commercial and private use with minimal restrictions beyond attribution and liability disclaimers.
Quickstart
pip install kubernetes-typed
# Configure mypy to use the plugin:
# [mypy]
# plugins = kubernetes_typed.plugin
from kubernetes_typed.client import V1PodDict
pod_manifest: V1PodDict = {
"apiVersion": "v1",
"kind": "Pod",
"metadata": {"name": "test-pod"},
}
Requires mypy to be installed and configured; CRDs using additionalProperties are not supported.
Verify before relying
- Whether the plugin works reliably with mypy versions beyond those tested during development
- Performance impact when type-checking large numbers of custom resources
- Compatibility with recent kubernetes-client library versions
Package facts
| License | Apache License Version 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — jsonschema-typed-v2, jsonschema, mypy, mypy-extensions, PyYAML |
| Maintenance | dormant — 711 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 171,421/month — #10,367 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: kubernetes_typed-18.20.2-py3-none-any.whl
Keywords: Kubernetes, MyPy, Stubs, Typing
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
kubernetes-stubsProvides Python type stubs for the Kubernetes…
permissive · top 15,000 on PyPI
kr8sA Python client library for Kubernetes that…
permissive · top 5,000 on PyPI
lightkube-modelsProvides Python type definitions and model…
permissive · top 15,000 on PyPI
openshiftPython client library for interacting with…
permissive · top 15,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
k8Provides Python type models for Kubernetes…
permissive · top 15,000 on PyPI
kubernetes-stubs-elephant-forkProvides type stubs for the Kubernetes Python…
permissive · top 5,000 on PyPI
kubernetes-asyncioAsynchronous Python client for the Kubernetes…
permissive · top 5,000 on PyPI
kubernetesProvides a Python interface to the Kubernetes…
permissive · top 1,000 on PyPI
pulumi-kubernetesPulumi Kubernetes Resource Provider lets you…
permissive · top 5,000 on PyPI