--- id: k8 version: "29.0.9" license: unclear license_treatment: permissive maintenance: dormant --- # k8 — Kubernetes Python Models License: permissive · Maintenance: dormant · Downloads: 305.1K/mo ## 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 above — 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 pip install k8 uv add k8 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_current - Install friction: low - Maintenance: dormant - Downloads: 305.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags kubernetes python models, k8s type definitions, openapi kubernetes, kubernetes api types, pydantic kubernetes models, kubernetes, type-safe-models, openapi-generated [View on SkillFed](https://skillfed.io/packages/k8) · [View on PyPI](https://pypi.org/project/k8/)