skillfed

k8

Kubernetes Python Models

k8 v29.0.9 305.1K downloads/30d#7,798 on PyPI0
Permissive license DORMANT released

What it is and what it does

k8 is a Python package that provides type-safe models for Kubernetes resources. It generates these models from OpenAPI specifications, allowing developers to work with Kubernetes API objects as strongly-typed Python classes rather than raw dictionaries. The package depends on pydantic for data validation and aenum for enumeration support, making it suitable for applications that need to programmatically interact with Kubernetes clusters or manifests.

The package is generated via a refresh script, suggesting it is derived from upstream Kubernetes OpenAPI definitions. It targets Python 3.11 and maintains a permissive MIT license. Maintenance is dormant with the last release on 2024-05-23. This makes it appropriate for stable, read-heavy use cases but not for projects requiring active development or rapid API updates.

Use it for:

  • Generate type-checked Python code for Kubernetes manifests and configurations.
  • Build CLI tools or automation scripts that interact with Kubernetes APIs with IDE autocomplete.
  • Validate Kubernetes resource definitions programmatically before deployment.
  • Integrate Kubernetes object models into Python-based infrastructure-as-code frameworks.

Worth the install?

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

Provides Python type models for Kubernetes resources, generated from OpenAPI specifications, enabling type-safe interaction with Kubernetes APIs.

Yes, if you need type-safe Kubernetes models and can tolerate dormant maintenance. The low install friction, permissive license, and stable API surface make it suitable for production use in applications that don't require frequent Kubernetes API updates. Not recommended if you need active maintenance or support for the latest Kubernetes features.

Install

k8 on PyPI

pip

pip install k8

uv

uv add k8

poetry

poetry add k8

Installing k8

Before you install

Low install friction with a pure-Python wheel. Maintenance is dormant—last release was in May 2024, though the repository remains active. Suitable for stable use cases but expect no updates.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions, making it safe for both open-source and commercial projects.

Quickstart

pip install k8

from k8 import models
# Use Kubernetes model types for API interactions
deployment = models.Deployment(...)

Requires Python 3.11 or later.

Verify before relying

  • Whether the generated models cover all current Kubernetes API versions or only a specific version.
  • How frequently the models need regeneration to stay aligned with Kubernetes API changes.
  • Whether pydantic v2 or v1 compatibility is maintained.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pydantic, aenum
Maintenance dormant — 813 days since the last release
Last repo commit
First released
Downloads 305,114/month — #7,798 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: k8-29.0.9-py3-none-any.whl

Keywords: OpenAPI, OpenAPI-Generator, Kubernetes

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

kubernetes python modelsk8s type definitionsopenapi kuberneteskubernetes api typespydantic kubernetes models
kubernetestype-safe-modelsopenapi-generated

More Distributed Computing packages