{"id":23864333,"url":"https://github.com/cloudcoil/cloudcoil","last_synced_at":"2025-04-06T04:09:03.674Z","repository":{"id":269891417,"uuid":"908768889","full_name":"cloudcoil/cloudcoil","owner":"cloudcoil","description":"Modern async-first Kubernetes client for Python with Pydantic models - bringing cloud-native operations and K8s development to life with elegant Pythonic APIs","archived":false,"fork":false,"pushed_at":"2025-03-13T22:10:35.000Z","size":1303,"stargazers_count":55,"open_issues_count":15,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T03:09:05.782Z","etag":null,"topics":["async","client","cloud","cloud-native","k8s","kubernetes","modern","pydantic","pytest-plugin","python"],"latest_commit_sha":null,"homepage":"https://cloudcoil.github.io/cloudcoil/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudcoil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-26T23:23:10.000Z","updated_at":"2025-03-20T21:35:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"956fe24e-d123-49cf-9af3-7516e1f55796","html_url":"https://github.com/cloudcoil/cloudcoil","commit_stats":null,"previous_names":["cloudcoil/cloudcoil"],"tags_count":58,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcoil%2Fcloudcoil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcoil%2Fcloudcoil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcoil%2Fcloudcoil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudcoil%2Fcloudcoil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudcoil","download_url":"https://codeload.github.com/cloudcoil/cloudcoil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430868,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","client","cloud","cloud-native","k8s","kubernetes","modern","pydantic","pytest-plugin","python"],"created_at":"2025-01-03T08:20:53.432Z","updated_at":"2025-04-06T04:09:03.572Z","avatar_url":"https://github.com/cloudcoil.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# cloudcoil\n\n🚀 Cloud native operations made beautifully simple with Python\n\n[![PyPI](https://img.shields.io/pypi/v/cloudcoil.svg)](https://pypi.python.org/pypi/cloudcoil)\n[![Downloads](https://static.pepy.tech/badge/cloudcoil)](https://pepy.tech/project/cloudcoil)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/license/apache-2-0/)\n[![CI](https://github.com/cloudcoil/cloudcoil/actions/workflows/ci.yml/badge.svg)](https://github.com/cloudcoil/cloudcoil/actions/workflows/ci.yml)\n\n\u003e Modern, async-first Kubernetes client with elegant Pythonic syntax and full type safety\n\n## 🤝 Support the Project\n\nIf you find Cloudcoil useful, please consider giving it a star on GitHub! Your support helps the project grow and encourages continued development.\n\n[![Star on GitHub](https://img.shields.io/github/stars/cloudcoil/cloudcoil.svg?style=social)](https://github.com/cloudcoil/cloudcoil)\n\n## ✨ Features\n\n- 🔥 **Elegant, Pythonic API** - Feels natural to Python developers including fluent and context manager style resource builders\n- ⚡ **Async First** - Native async/await support for high performance\n- 🛡️ **Type Safe** - Full mypy support and runtime validation\n- 🧪 **Testing Ready** - Built-in pytest fixtures for K8s integration tests\n- 📦 **Zero Config** - Works with your existing kubeconfig\n- 🪶 **Minimal Dependencies** - Only requires httpx, pydantic, and pyyaml\n\n## 🔧 Installation\n\n\u003e [!NOTE]\n\u003e For versioning information and compatibility, see the [Versioning Guide](https://github.com/cloudcoil/cloudcoil/blob/main/VERSIONING.md).\n\nUsing [uv](https://github.com/astral-sh/uv) (recommended):\n\n```bash\n# Install with Kubernetes support\nuv add cloudcoil[kubernetes]\n\n# Install with specific Kubernetes version compatibility\nuv add cloudcoil[kubernetes-1-29]\nuv add cloudcoil[kubernetes-1-30]\nuv add cloudcoil[kubernetes-1-31]\nuv add cloudcoil[kubernetes-1-32]\n```\n\nUsing pip:\n\n```bash\npip install cloudcoil[kubernetes]\n```\n\n## 🔌 Integrations\n\nDiscover more Cloudcoil model integrations for popular Kubernetes operators and CRDs at [cloudcoil-models on GitHub](https://github.com/topics/cloudcoil-models).\n\nCurrent first-class integrations include:\n\n| Name | Github | PyPI | \n| ------- | ------- | -------  | \n| [cert-manager](https://github.com/cert-manager/cert-manager) | [models-cert-manager](https://github.com/cloudcoil/models-cert-manager) | [cloudcoil.models.cert_manager](https://pypi.org/project/cloudcoil.models.cert-manager) |\n| [fluxcd](https://github.com/fluxcd/flux2) | [models-fluxcd](https://github.com/cloudcoil/models-fluxcd) | [cloudcoil.models.fluxcd](https://pypi.org/project/cloudcoil.models.fluxcd) |\n| [istio](https://github.com/istio/istio) | [models-istio](https://github.com/cloudcoil/models-istio) | [cloudcoil.models.istio](https://pypi.org/project/cloudcoil.models.istio) |\n| [keda](https://github.com/kedacore/keda) | [models-keda](https://github.com/cloudcoil/models-keda) | [cloudcoil.models.keda](https://pypi.org/project/cloudcoil.models.keda) |\n| [knative-serving](https://github.com/knative/serving) | [models-knative-serving](https://github.com/cloudcoil/models-knative-serving) | [cloudcoil.models.knative_serving](https://pypi.org/project/cloudcoil.models.knative-serving) |\n| [knative-eventing](https://github.com/knative/eventing) | [models-knative-eventing](https://github.com/cloudcoil/models-knative-eventing) | [cloudcoil.models.knative_eventing](https://pypi.org/project/cloudcoil.models.knative-eventing) |\n| [kpack](https://github.com/pivotal/kpack) | [models-kpack](https://github.com/cloudcoil/models-kpack) | [cloudcoil.models.kpack](https://pypi.org/project/cloudcoil.models.kpack) |\n| [kyverno](https://github.com/kyverno/kyverno) | [models-kyverno](https://github.com/cloudcoil/models-kyverno) | [cloudcoil.models.kyverno](https://pypi.org/project/cloudcoil.models.kyverno) |\n| [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator) | [models-prometheus-operator](https://github.com/cloudcoil/models-prometheus-operator) | [cloudcoil.models.prometheus_operator](https://pypi.org/project/cloudcoil.models.prometheus_operator) |\n| [sealed-secrets](https://github.com/bitnami-labs/sealed-secrets) | [models-sealed-secrets](https://github.com/cloudcoil/models-sealed-secrets) | [cloudcoil.models.sealed_secrets](https://pypi.org/project/cloudcoil.models.sealed_secrets) |\n| [velero](https://github.com/vmware-tanzu/velero) | [models-velero](https://github.com/cloudcoil/models-velero) | [cloudcoil.models.velero](https://pypi.org/project/cloudcoil.models.velero) |\n\nYou can install these integrations using\n\n```bash\nuv add cloudcoil[kyverno]\n# You can also install multiple dependencies at once\nuv add cloudcoil[cert-manager,fluxcd,kyverno]\n# You can also install all available models in cloudcoil using\nuv add cloudcoil[all-models]\n```\n\n\u003e Missing an integration you need? [Open a model request](https://github.com/cloudcoil/cloudcoil/issues/new?template=%F0%9F%94%8C-model-request.md) to suggest a new integration!\n\n## 💡 Examples\n\n### Reading Resources\n\n```python\nfrom cloudcoil.client import Config\nimport cloudcoil.models.kubernetes as k8s\n\n# Get a resource - as simple as that!\nservice = k8s.core.v1.Service.get(\"kubernetes\")\n\n# List resources with elegant pagination\nfor pod in k8s.core.v1.Pod.list(namespace=\"default\"):\n    print(f\"Found pod: {pod.metadata.name}\")\n\n# Async support out of the box\nasync for pod in await k8s.core.v1.Pod.async_list():\n    print(f\"Found pod: {pod.metadata.name}\")\n```\n### Building resources\n\n#### Using Models\n\n```python\nfrom cloudcoil import apimachinery\nimport cloudcoil.models.kubernetes.core.v1 as k8score\nimport cloudcoil.models.kubernetes.apps.v1 as k8sapps\n\n# Create a Deployment\ndeployment = k8sapps.Deployment(\n    metadata=apimachinery.ObjectMeta(name=\"nginx\"),\n    spec=k8sapps.DeploymentSpec(\n        replicas=3,\n        selector=apimachinery.LabelSelector(\n            match_labels={\"app\": \"nginx\"}\n        ),\n        template=k8score.PodTemplateSpec(\n            metadata=apimachinery.ObjectMeta(\n                labels={\"app\": \"nginx\"}\n            ),\n            spec=k8score.PodSpec(\n                containers=[\n                    k8score.Container(\n                        name=\"nginx\",\n                        image=\"nginx:latest\",\n                        ports=[k8score.ContainerPort(container_port=80)]\n                    )\n                ]\n            )\n        )\n    )\n).create()\n\n# Create a Service\nservice = k8score.Service(\n    metadata=apimachinery.ObjectMeta(name=\"nginx\"),\n    spec=k8score.ServiceSpec(\n        selector={\"app\": \"nginx\"},\n        ports=[k8score.ServicePort(port=80, target_port=80)]\n    )\n).create()\n\n# List Deployments\nfor deploy in k8sapps.Deployment.list():\n    print(f\"Found deployment: {deploy.metadata.name}\")\n\n# Update a Deployment\ndeployment.spec.replicas = 5\ndeployment.save()\n\n# Delete resources\nk8score.Service.delete(\"nginx\")\nk8sapps.Deployment.delete(\"nginx\")\n```\n\n#### Using the Fluent Builder API\n\nCloudcoil provides a powerful fluent builder API for Kubernetes resources with full IDE support and rich autocomplete capabilities:\n\n```python\nfrom cloudcoil.models.kubernetes.apps.v1 import Deployment\nfrom cloudcoil.models.kubernetes.core.v1 import Service\n\n# Create a Deployment using the fluent builder\n# The fluent style is great for one-liners and simple configurations\nnginx_deployment = (\n    Deployment.builder()\n    # Metadata can be configured in a single chain for simple objects\n    .metadata(lambda metadata: metadata\n        .name(\"nginx\")\n        .namespace(\"default\")\n    )\n    # Complex nested structures can be built using nested lambda functions\n    .spec(lambda deployment_spec: deployment_spec\n        .replicas(3)\n        # Each level of nesting gets its own lambda for clarity\n        .selector(lambda label_selector: label_selector\n            .match_labels({\"app\": \"nginx\"})\n        )\n        .template(lambda pod_template: pod_template\n            .metadata(lambda pod_metadata: pod_metadata\n                .labels({\"app\": \"nginx\"})\n            )\n            .spec(lambda pod_spec: pod_spec\n                # Lists can be built using array literals with lambda items\n                .containers([\n                    lambda container: container\n                    .name(\"nginx\")\n                    .image(\"nginx:latest\")\n                    # Nested collections can use the add() helper\n                    .ports(lambda port_list: port_list.add(\n                        lambda port: port.container_port(80)\n                    ))\n                ])\n            )\n        )\n    )\n    .build()\n)\n\n# Create a Service using the builder\nservice = (\n    Service.builder()\n    .metadata(lambda m: m\n        .name(\"nginx\")\n        .namespace(\"default\")\n    )\n    .spec(lambda s: s\n        .selector({\"app\": \"nginx\"})\n        .ports(lambda ports: ports.add(lambda p: p.container_port(80)))\n    )\n    .build()\n)\n```\n\nThe fluent builder provides:\n- ✨ Full IDE support with detailed type information\n- 🔍 Rich autocomplete for all fields and nested objects\n- ⚡ Compile-time validation of your configuration\n- 🎯 Clear and chainable API that guides you through resource creation\n\n#### Using the Context Manager Builder API\n\nFor complex nested resources, Cloudcoil also provides a context manager-based builder pattern that can make the structure more clear:\n\n```python\nfrom cloudcoil.models.kubernetes.apps.v1 import Deployment\nfrom cloudcoil.models.kubernetes.core.v1 import Service\n\n# Create a deployment using context managers\n# Context managers are ideal for deeply nested structures\nwith Deployment.new() as nginx_deployment:\n    # Each context creates a clear visual scope\n    with nginx_deployment.metadata() as deployment_metadata:\n        deployment_metadata.name(\"nginx\")\n        deployment_metadata.namespace(\"default\")\n    \n    with nginx_deployment.spec() as deployment_spec:\n        # Simple fields can be set directly\n        deployment_spec.replicas(3)\n        \n        # Each nested object gets its own context\n        with deployment_spec.selector() as label_selector:\n            label_selector.match_labels({\"app\": \"nginx\"})\n        \n        with deployment_spec.template() as pod_template:\n            with pod_template.metadata() as pod_metadata:\n                pod_metadata.labels({\"app\": \"nginx\"})\n            \n            with pod_template.spec() as pod_spec:\n                # Collections use a parent context for the list\n                with pod_spec.containers() as container_list:\n                    # And child contexts for each item\n                    with container_list.add() as nginx_container:\n                        nginx_container.name(\"nginx\")\n                        nginx_container.image(\"nginx:latest\")\n                        # Ports can be added one by one\n                        with nginx_container.add_port() as container_port:\n                            container_port.container_port(80)\n\nfinal_deployment = nginx_deployment.build()\n\n# Create a service using context managers\nwith Service.new() as nginx_service:\n    # Context managers make the structure very clear\n    with nginx_service.metadata() as service_metadata:\n        service_metadata.name(\"nginx\")\n        service_metadata.namespace(\"default\")\n    \n    with nginx_service.spec() as service_spec:\n        # Simple fields can still be set directly\n        service_spec.selector({\"app\": \"nginx\"})\n        # Port configuration is more readable with contexts\n        with service_spec.add_port() as service_port:\n            service_port.port(80)\n            service_port.target_port(80)\n\nfinal_service = nginx_service.build()\n```\n\nThe context manager builder provides:\n- 🎭 Clear visual nesting of resource structure\n- 🔒 Automatic resource cleanup\n- 🎯 Familiar Python context manager pattern\n- ✨ Same great IDE support as the fluent builder\n\n#### Mixing Builder Styles\n\nCloudCoil's intelligent builder system automatically detects which style you're using and provides appropriate IDE support:\n\n```python\nfrom cloudcoil.models.kubernetes.apps.v1 import Deployment\nfrom cloudcoil import apimachinery\n\n# Mixing styles lets you choose the best approach for each part\n# The IDE automatically adapts to your chosen style at each level\nwith Deployment.new() as nginx_deployment:\n    # Direct object initialization with full type checking\n    nginx_deployment.metadata(apimachinery.ObjectMeta(\n        name=\"nginx\",\n        namespace=\"default\",\n        labels={\"app\": \"nginx\"}\n    ))\n    \n    with nginx_deployment.spec() as deployment_spec:\n        # IDE shows all available fields with types\n        deployment_spec.replicas(3)\n        # Fluent style with rich autocomplete\n        deployment_spec.selector(lambda sel: sel.match_labels({\"app\": \"nginx\"}))\n        \n        # Context manager style with full type hints\n        with deployment_spec.template() as pod_template:\n            # Mix and match freely - IDE adjusts automatically\n            pod_template.metadata(apimachinery.ObjectMeta(labels={\"app\": \"nginx\"}))\n            with pod_template.spec() as pod_spec:\n                with pod_spec.containers() as container_list:\n                    with container_list.add() as nginx_container:\n                        # Complete IDE support regardless of style\n                        nginx_container.name(\"nginx\")\n                        nginx_container.image(\"nginx:latest\")\n                        # Switch styles any time\n                        nginx_container.ports(lambda ports: ports\n                            .add(lambda p: p.container_port(80))\n                            .add(lambda p: p.container_port(443))\n                        )\n\nfinal_deployment = nginx_deployment.build()\n```\n\nThis flexibility allows you to:\n- 🔀 Choose the most appropriate style for each part of your configuration\n- 📖 Maximize readability for both simple and complex structures\n- 🎨 Format your code according to your team's preferences\n- 🧠 Get full IDE support with automatic style detection\n- ✨ Enjoy rich autocomplete in all styles\n- ⚡ Benefit from type checking across mixed styles\n- 🎯 Receive immediate feedback on type errors\n- 🔍 See documentation for all fields regardless of style\n\n\n### Creating Resources\n\n```python\n# Create with Pythonic syntax\nnamespace = k8s.core.v1.Namespace(\n    metadata=dict(name=\"dev\")\n).create()\n\n# Generate names automatically\ntest_ns = k8s.core.v1.Namespace(\n    metadata=dict(generate_name=\"test-\")\n).create()\n```\n\n### Modifying Resources\n\n```python\n# Update resources fluently\ndeployment = k8s.apps.v1.Deployment.get(\"web\")\ndeployment.spec.replicas = 3\ndeployment.update()\n\n# Or use the save method which handles both create and update\nconfigmap = k8s.core.v1.ConfigMap(\n    metadata=dict(name=\"config\"),\n    data={\"key\": \"value\"}\n)\nconfigmap.save()  # Creates the ConfigMap\n\nconfigmap.data[\"key\"] = \"new-value\"\nconfigmap.save()  # Updates the ConfigMap\n```\n\n### Deleting Resources\n\n```python\n# Delete by name\nk8s.core.v1.Pod.delete(\"nginx\", namespace=\"default\")\n\n# Or remove the resource instance\npod = k8s.core.v1.Pod.get(\"nginx\")\npod.remove()\n```\n\n### Watching Resources\n\n```python\nfor event_type, resource in k8s.core.v1.Pod.watch(field_selector=\"metadata.name=mypod\"):\n    # Wait for the pod to be deleted\n    if event_type == \"DELETED\":\n        break\n\n# You can also use the async watch\nasync for event_type, resource in await k8s.core.v1.Pod.async_watch(field_selector=\"metadata.name=mypod\"):\n    # Wait for the pod to be deleted\n    if event_type == \"DELETED\":\n        break\n```\n\n### Waiting for Resources\n\n```python\n# Wait for a resource to reach a desired state\npod = k8s.core.v1.Pod.get(\"nginx\")\npod.wait_for(lambda _, pod: pod.status.phase == \"Running\", timeout=300)\n\n# You can also check of the resource to be deleted\nawait pod.async_wait_for(lambda event, _: event == \"DELETED\", timeout=300)\n\n# You can also supply multiple conditions. The wait will end when the first condition is met.\n# It will also return the key of the condition that was met.\ntest_pod = k8s.core.v1.Pod.get(\"tests\")\nstatus = await test_pod.async_wait_for({\n    \"succeeded\": lambda _, pod: pod.status.phase == \"Succeeded\",\n    \"failed\": lambda _, pod: pod.status.phase == \"Failed\"\n    }, timeout=300)\nassert status == \"succeeded\"\n```\n\n### Dynamic Resources\n\n```python\nfrom cloudcoil.resources import get_dynamic_resource\n\n# Get a dynamic resource class for any CRD or resource without a model\nDynamicJob = get_dynamic_resource(\"Job\", \"batch/v1\")\n\n# Create using dictionary syntax\njob = DynamicJob(\n    metadata={\"name\": \"dynamic-job\"},\n    spec={\n        \"template\": {\n            \"spec\": {\n                \"containers\": [{\"name\": \"job\", \"image\": \"busybox\"}],\n                \"restartPolicy\": \"Never\"\n            }\n        }\n    }\n)\n\n# Create on the cluster\ncreated = job.create()\n\n# Access fields using dict-like syntax\nassert created[\"spec\"][\"template\"][\"spec\"][\"containers\"][0][\"image\"] == \"busybox\"\n\n# Update fields\ncreated[\"spec\"][\"template\"][\"spec\"][\"containers\"][0][\"image\"] = \"alpine\"\nupdated = created.update()\n\n# Get raw dictionary representation\nraw_dict = updated.raw\n```\n\n### Resource Parsing\n\n```python\nfrom cloudcoil import resources\n\n# Parse YAML files\ndeployment = resources.parse_file(\"deployment.yaml\")\n\n# Parse multiple resources\nresources = resources.parse_file(\"k8s-manifests.yaml\", load_all=True)\n\n# Get resource class by GVK if its an existing resource model class\nJob = resources.get_model(\"Job\", api_version=\"batch/v1\")\n```\n\n### Context Management\n\n```python\n# Temporarily switch namespace\nwith Config(namespace=\"kube-system\"):\n    pods = k8s.core.v1.Pod.list()\n\n# Custom configs\nwith Config(kubeconfig=\"dev-cluster.yaml\"):\n    services = k8s.core.v1.Service.list()\n```\n\n\n## 🧪 Testing Integration\n\nCloudcoil provides powerful pytest fixtures for Kubernetes integration testing:\n\n### Installation\n\n\u003e uv add cloudcoil[test]\n\n### Basic Usage\n\n```python\nimport pytest\nfrom cloudcoil.models.kubernetes import core, apps\n\n@pytest.mark.configure_test_cluster\ndef test_deployment(test_config):\n    with test_config:\n        # Creates a fresh k3d cluster for testing\n        deployment = apps.v1.Deployment.get(\"app\")\n        assert deployment.spec.replicas == 3\n```\n\n### Advanced Configuration\n\n```python\n@pytest.mark.configure_test_cluster(\n    cluster_name=\"my-test-cluster\",     # Custom cluster name\n    k3d_version=\"v5.7.5\",              # Specific k3d version\n    k8s_version=\"v1.31.4\",             # Specific K8s version\n    k8s_image=\"custom/k3s:latest\",     # Custom K3s image\n    remove=True                         # Auto-remove cluster after tests\n)\nasync def test_advanced(test_config):\n    with test_config:\n        # Async operations work too!\n        service = await core.v1.Service.async_get(\"kubernetes\")\n        assert service.spec.type == \"ClusterIP\"\n```\n\n### Shared Clusters\n\nReuse clusters across tests for better performance:\n\n```python\n@pytest.mark.configure_test_cluster(\n    cluster_name=\"shared-cluster\",\n    remove=False  # Keep cluster after tests\n)\ndef test_first(test_config):\n    with test_config:\n        # Uses existing cluster if available\n        namespace = core.v1.Namespace.get(\"default\")\n        assert namespace.status.phase == \"Active\"\n\n@pytest.mark.configure_test_cluster(\n    cluster_name=\"shared-cluster\",  # Same cluster name\n    remove=True   # Last test removes the cluster\n)\ndef test_second(test_config):\n    with test_config:\n        # Uses same cluster as previous test\n        pods = core.v1.Pod.list(namespace=\"kube-system\")\n        assert len(pods) \u003e 0\n```\n\n### Parallel Testing\n\nThe fixtures are compatible with pytest-xdist for parallel testing:\n\n```bash\n# Run tests in parallel\npytest -n auto tests/\n\n# Or specify number of workers\npytest -n 4 tests/\n```\n\n### Testing Fixtures API\n\nThe testing module provides two main fixtures:\n\n- `test_cluster`: Creates and manages k3d clusters\n  - Returns path to kubeconfig file\n  - Handles cluster lifecycle\n  - Supports cluster reuse\n  - Compatible with parallel testing\n\n- `test_config`: Provides configured `Config` instance\n  - Uses test cluster kubeconfig\n  - Manages client connections\n  - Handles cleanup automatically\n  - Context manager support\n\n## 🛡️ MyPy Integration\n\ncloudcoil provides a mypy plugin that enables type checking for dynamically loaded kinds from the scheme. To enable the plugin, add this to your pyproject.toml:\n\n```toml\n# pyproject.toml\n[tool.mypy]\nplugins = ['cloudcoil.mypy']\n```\n\nThis plugin enables full type checking for scheme.get() calls when the kind name is a string literal:\n\n```py\nfrom cloudcoil import resources\n\n# This will be correctly typed as k8s.batch.v1.Job\njob_class = resources.get_model(\"Job\")\n\n# Type checking works on the returned class\njob = job_class(\n    metadata={\"name\": \"test\"},  # type checked!\n    spec={\n        \"template\": {\n            \"spec\": {\n                \"containers\": [{\"name\": \"test\", \"image\": \"test\"}],\n                \"restartPolicy\": \"Never\"\n            }\n        }\n    }\n)\n```\n\n## 🏗️ Model Generation\n\nCloudcoil supports generating typed models from CustomResourceDefinitions (CRDs). You can either use the provided cookiecutter template or set up model generation manually.\n\n### Using the Cookiecutter Template\n\nThe fastest way to get started is using our cookiecutter template: [cloudcoil-models-cookiecutter](https://github.com/cloudcoil/cloudcoil/tree/main/cookiecutter)\n\n### Codegen Config\n\nCloudcoil includes a CLI tool, cloudcoil-model-codegen, which reads configuration from your pyproject.toml under [tool.cloudcoil.codegen.models]. It supports options such as:\n\n• namespace: The Python package name for generated models  \n• input: Path or URL to CRD (YAML/JSON) or OpenAPI schema  \n• output: Output directory for the generated code  \n• mode: Either \"resource\" (default) or \"base\" for the generated class hierarchy  \n• crd-namespace: Inject a namespace for CRD resources  \n• transformations / updates: Modify the schema before generation  \n• exclude-unknown: Exclude definitions that cannot be mapped  \n• aliases: Aliases for properties\n• additional-datamodel-codegen-args: Pass extra flags to the underlying generator  \n\nExample pyproject.toml config - \n\n```toml\n[[tool.cloudcoil.codegen.models]]\n# Unique name for the models\n# This will be used as the name for the setuptools entrypoints\nnamespace = \"cloudcoil.models.fluxcd\"\ninput = \"https://github.com/fluxcd/flux2/releases/download/v2.4.0/install.yaml\"\ncrd-namespace = \"io.fluxcd.toolkit\"\n```\n\nFor more examples, check out the [cloudcoil-models](https://github.com/topics/cloudcoil-models) topic on Github.\n\nIf you are building a models package to be used with cloudcoil, please make sure to tag it with this topic for discovery.\n\n## 📚 Documentation\n\nFor complete documentation, visit [cloudcoil.github.io/cloudcoil](https://cloudcoil.github.io/cloudcoil)\n\n## 📜 License\n\nApache License, Version 2.0 - see [LICENSE](LICENSE)\n\n## 🌟 Stargazers over time\n[![Stargazers over time](https://starchart.cc/cloudcoil/cloudcoil.svg?variant=adaptive)](https://starchart.cc/cloudcoil/cloudcoil)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudcoil%2Fcloudcoil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudcoil%2Fcloudcoil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudcoil%2Fcloudcoil/lists"}