{ "info": { "author": "Monasca team", "author_email": "monasca@lists.launchpad.net", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "tiny-kubernetes\n===============\n\n`tiny-kubernetes` provides a thin wrapper on top of [requests][0] to make it\neasier to work with Kubernetes APIs.\n\nFeatures\n--------\n\n * Automatic authentication (`$KUBECONFIG`)\n * Simplified response traversal (`never['do']['this']['again']`) thanks to\n [DotMap][2]\n * Sane exceptions\n * No crazy complex client-side APIs to deal with\n\nWhy?\n----\n\nThe official [kubernetes][1] package is, uh, complex. While it does support all\nthe advanced features the Kubernetes API offers (like WebSocket streaming) it is\noften non-trivial to work with. tiny-kubernetes aims to provide most of the same\nfunctionality with minimal overhead.\n\nInstallation\n------------\n\n```\npip install tiny-kubernetes\n```\n\nUsage\n-----\n\n```python\nfrom tiny_kubernetes import KubernetesAPIClient\n\nclient = KubernetesAPIClient()\nclient.load_auto_config()\n\npods = client.get('/api/v1/namespaces/{}/pods', 'default')\nfor pod in pods['items']:\n print pod.metadata.name\n```\n\nNotice that you can access (almost) all parts of the Kubernetes API response\nusing dot accessors (courtesy of [DotMap][2]). As `.items()` is a reserved name\nin dictionaries, it needs to be accessed more traditionally, but most other\nmember names can use the shortened syntax.\n\nThe endpoint is formatted using [`str.format`][3] with the remaining positional\narguments. All keyword arguments are passed through to requests's\n[`Session.request`][4], so you can include a body with `json={...}` or URL\nparameters with `params={...}`.\n\nA special `json_patch` method exists to help perform patches. It works around\na few potential requests bugs automatically. For example, it can be used to\nappend labels to a resource:\n\n```python\nclient.json_patch([{\n 'op': 'add',\n 'path': '/metadata/labels/foo',\n 'value': 'bar'\n}], '/api/v1/namespaces/{}/pods/{}', 'default', 'some-pod')\n```\n\nNotes\n-----\n\n * Temporary files may be created if using a local `$KUBECONFIG` with\n base64-encoded certificates. Due to limitations in python's SSL library these\n must be decoded and written to the filesystem to be used. They should be\n cleaned up when the interpreter exits.\n\n\n[0]: http://docs.python-requests.org/en/master/\n[1]: https://github.com/kubernetes-incubator/client-python\n[2]: https://github.com/drgrib/dotmap\n[3]: https://docs.python.org/2/library/stdtypes.html#str.format\n[4]: http://docs.python-requests.org/en/master/api/#requests.Session.request", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/monasca/tiny-kubernetes/", "keywords": "", "license": "Apache-2", "maintainer": "", "maintainer_email": "", "name": "tiny-kubernetes", "package_url": "https://pypi.org/project/tiny-kubernetes/", "platform": "", "project_url": "https://pypi.org/project/tiny-kubernetes/", "project_urls": { "Homepage": "http://github.com/monasca/tiny-kubernetes/" }, "release_url": "https://pypi.org/project/tiny-kubernetes/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "A tiny Kubernetes client for Python", "version": "1.1.1" }, "last_serial": 5005335, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "41154c4d1d0383a477167d224cbb7c5f", "sha256": "f93d7bc7780de1819970aa4e64fbd674db127861a5aa9f943c488a55374601fc" }, "downloads": -1, "filename": "tiny-kubernetes-1.0.0.tar.gz", "has_sig": false, "md5_digest": "41154c4d1d0383a477167d224cbb7c5f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19738, "upload_time": "2018-05-15T17:02:27", "url": "https://files.pythonhosted.org/packages/87/2f/1197ea67d29a33895a80d647c4b2fe4aecf5255021044ab3bad685df2720/tiny-kubernetes-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "631f276d3bb347359db49f678915ed1b", "sha256": "ce58d371ca11e1e2384f42d282e2f572a693c8fb831112f347518d9d5e14cea7" }, "downloads": -1, "filename": "tiny-kubernetes-1.0.1.tar.gz", "has_sig": true, "md5_digest": "631f276d3bb347359db49f678915ed1b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19798, "upload_time": "2018-05-15T17:08:18", "url": "https://files.pythonhosted.org/packages/ff/d0/2dc25df79d410aff10f322038c3b35fbd9cdfdba4943e555672ad435fa24/tiny-kubernetes-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "cac318c075cfb238450adeb0f6947f25", "sha256": "bf43b12c06db0f0d830b994857eb38057ef283ee2fe27a0c65c08da45002559b" }, "downloads": -1, "filename": "tiny-kubernetes-1.1.0.tar.gz", "has_sig": true, "md5_digest": "cac318c075cfb238450adeb0f6947f25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19930, "upload_time": "2018-09-17T20:12:04", "url": "https://files.pythonhosted.org/packages/10/93/ec18ea6f4c63620abf952bb04f07026135f9d13085170f79fbc7cf1a275e/tiny-kubernetes-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "a39b77cf0a2346b0933abac9257efd4d", "sha256": "669bc5d827e0baceca9707ba22a7de03ff6abe25c8554e10fd1e0ec51dcb273e" }, "downloads": -1, "filename": "tiny-kubernetes-1.1.1.tar.gz", "has_sig": true, "md5_digest": "a39b77cf0a2346b0933abac9257efd4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20017, "upload_time": "2019-03-29T22:37:04", "url": "https://files.pythonhosted.org/packages/10/92/0689893536a40ab6414cae0c5f9d784d941ae6ccfba4c61f78a6068150ff/tiny-kubernetes-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a39b77cf0a2346b0933abac9257efd4d", "sha256": "669bc5d827e0baceca9707ba22a7de03ff6abe25c8554e10fd1e0ec51dcb273e" }, "downloads": -1, "filename": "tiny-kubernetes-1.1.1.tar.gz", "has_sig": true, "md5_digest": "a39b77cf0a2346b0933abac9257efd4d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20017, "upload_time": "2019-03-29T22:37:04", "url": "https://files.pythonhosted.org/packages/10/92/0689893536a40ab6414cae0c5f9d784d941ae6ccfba4c61f78a6068150ff/tiny-kubernetes-1.1.1.tar.gz" } ] }