{"id":13549665,"url":"https://github.com/tomplus/kubernetes_asyncio","last_synced_at":"2025-05-14T01:02:17.587Z","repository":{"id":31673759,"uuid":"128578499","full_name":"tomplus/kubernetes_asyncio","owner":"tomplus","description":"Python asynchronous client library for Kubernetes http://kubernetes.io/","archived":false,"fork":false,"pushed_at":"2025-04-30T21:57:44.000Z","size":15706,"stargazers_count":386,"open_issues_count":18,"forks_count":75,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-05T12:43:50.308Z","etag":null,"topics":["aio","aiohttp","async","asynchronous","asyncio","kubernetes","python"],"latest_commit_sha":null,"homepage":"","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/tomplus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-07T23:55:49.000Z","updated_at":"2025-04-30T21:55:51.000Z","dependencies_parsed_at":"2024-06-07T12:30:03.537Z","dependency_job_id":"fbd0d02b-d213-4606-b47d-9792c8990003","html_url":"https://github.com/tomplus/kubernetes_asyncio","commit_stats":{"total_commits":343,"total_committers":38,"mean_commits":9.026315789473685,"dds":"0.29446064139941686","last_synced_commit":"3ab640847b51da92e4231d568d726a8e4d268df7"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fkubernetes_asyncio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fkubernetes_asyncio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fkubernetes_asyncio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomplus%2Fkubernetes_asyncio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomplus","download_url":"https://codeload.github.com/tomplus/kubernetes_asyncio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253617998,"owners_count":21936899,"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":["aio","aiohttp","async","asynchronous","asyncio","kubernetes","python"],"created_at":"2024-08-01T12:01:24.230Z","updated_at":"2025-05-14T01:02:17.254Z","avatar_url":"https://github.com/tomplus.png","language":"Python","funding_links":[],"categories":["Python","Misc"],"sub_categories":[],"readme":"# Kubernetes Python Client\n\n![Build status](https://github.com/tomplus/kubernetes_asyncio/workflows/Tests/badge.svg)\n[![PyPI version](https://badge.fury.io/py/kubernetes_asyncio.svg)](https://badge.fury.io/py/kubernetes_asyncio)\n[![Docs](https://readthedocs.org/projects/kubernetes-asyncio/badge/)](https://kubernetes-asyncio.readthedocs.io/)\n[![codecov](https://codecov.io/gh/tomplus/kubernetes_asyncio/branch/master/graph/badge.svg)](https://codecov.io/gh/tomplus/kubernetes_asyncio)\n[![pypi supported versions](https://img.shields.io/pypi/pyversions/kubernetes_asyncio.svg)](https://pypi.python.org/pypi/kubernetes_asyncio)\n[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Silver-blue.svg?style=flat\u0026colorB=C0C0C0\u0026colorA=306CE8)](http://bit.ly/kubernetes-client-capabilities-badge)\n[![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=flat\u0026colorA=306CE8)](http://bit.ly/kubernetes-client-support-badge)\n\nAsynchronous (AsyncIO) client library for the [Kubernetes](http://kubernetes.io/) API.\n\nThis library is created in the same way as official https://github.com/kubernetes-client/python but\nuses asynchronous version of [OpenAPI generator](https://github.com/openapitools/openapi-generator).\nMy motivation is described here: https://github.com/kubernetes-client/python/pull/324\n\n## Installation\n\nFrom [PyPi](https://pypi.python.org/pypi/kubernetes_asyncio/) directly:\n\n```\npip install kubernetes_asyncio\n```\n\nIt requires Python 3.6+\n\n## Example\n\nTo list all pods:\n\n```python\nimport asyncio\nfrom kubernetes_asyncio import client, config\nfrom kubernetes_asyncio.client.api_client import ApiClient\n\n\nasync def main():\n    # Configs can be set in Configuration class directly or using helper\n    # utility. If no argument provided, the config will be loaded from\n    # default location.\n    await config.load_kube_config()\n\n    # use the context manager to close http sessions automatically\n    async with ApiClient() as api:\n\n        v1 = client.CoreV1Api(api)\n        print(\"Listing pods with their IPs:\")\n        ret = await v1.list_pod_for_all_namespaces()\n\n        for i in ret.items:\n            print(i.status.pod_ip, i.metadata.namespace, i.metadata.name)\n\n\nif __name__ == '__main__':\n    asyncio.run(main())\n```\n\nMore complicated examples, like asynchronous multiple watch or tail logs from pods,\nyou can find in `examples/` folder.\n\n## Documentation\n\nhttps://kubernetes-asyncio.readthedocs.io/\n\n## Compatibility\n\nThis library is generated in the same way as the official Kubernetes Python Library. It uses swagger-codegen and the same concepts\nlike streaming, watching or reading configuration. Because of an early stage of this library some differences still exist:\n\n|  | [synchronous library kubernetes-client/python](https://github.com/kubernetes-client/python) | [this library](https://github.com/tomplus/kubernetes_asyncio/) |\n|--|--------------------------------------------------------------------|---------------------------------------------------------------|\n| authentication method | gcp-token, azure-token, user-token, oidc-token, user-password, in-cluster | gcp-token (only via gcloud command), user-token, oidc-token, user-password, in-cluster |\n| streaming data via websocket from PODs | bidirectional | read-only is already implemented |\n\n### Microsoft Windows\nIn case this library is used against Kubernetes cluster using [client-go credentials plugin](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins), the default asyncio event loop is  [SelectorEventLoop](https://docs.python.org/3/library/asyncio-eventloop.html#event-loop-implementations). This event loop selector, however, does NOT support [pipes and subprocesses](https://bugs.python.org/issue37373), so `exec_provider.py::ExecProvider` is failing. In order to avoid failures the [ProactorEventLoop](https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.ProactorEventLoop) has to be selected. The ProactorEventLoop can be enabled via [WindowsProactorEventLoopPolicy](https://docs.python.org/3/library/asyncio-policy.html#asyncio.WindowsProactorEventLoopPolicy). \n\nApplication's code needs to contain following code:\n\n```python\nimport asyncio\n\nasyncio.set_event_loop_policy(\n    asyncio.WindowsProactorEventLoopPolicy()\n)\n```\n\n## Versions\n\nThis library is versioned in the same way as the synchronous library.\nThe schema version has been changed with version v18.20.0. Now, first\ntwo numbers from version are Kubernetes version (v.1.18.20). The last\nnumber is for changes in the library not directly connected with K8s.\n\n## Development\nInstall the development packages:\n\n```bash\npip install -r requirements.txt\npip install -r test-requirements.txt\n```\n\nYou can run the style checks and tests with\n\n```bash\nflake8 kubernetes_asyncio/\nisort --diff kubernetes_asyncio/\npy.test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomplus%2Fkubernetes_asyncio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomplus%2Fkubernetes_asyncio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomplus%2Fkubernetes_asyncio/lists"}