## Python client for Gnetcli GRPC server
Gnetcli provides a universal way to execute arbitrary commands using a CLI,
eliminating the need for screen scraping with expect.
See documentation on [gnetcli server](https://annetutil.github.io/gnetcli/).
Example:
```python
from gnetclisdk.client import Credentials, Gnetcli, HostParams
import os, asyncio
async def example():
api = Gnetcli(insecure_grpc=True)
# api = Gnetcli(insecure_grpc=True, auth_token="Basic " + base64.b64encode(f"{username}:{password}".encode('utf-8')).decode("ascii")
dev_creds = Credentials(os.environ.get("LOGIN"), os.environ.get("PASSWORD"))
res = await api.cmd(hostname="myhost", cmd="dis clock", host_params=HostParams(device="huawei", credentials=dev_creds))
print("err=%s status=%s out=%s" % (res.error, res.status, res.out))
asyncio.run(example())
```
Output:
```
err=b'' status=0 out=b'2023-11-10 09:31:58\nFriday\nTime Zone(UTC) : UTC'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/annetutil/gnetcli",
"name": "gnetclisdk",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Alexander Balezin",
"author_email": "gescheit12@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7c/d6/e7ea6a6039fd83bac2b57fe7f5989700253f050a3d14981ecf938abff1b4/gnetclisdk-1.0.101.tar.gz",
"platform": null,
"description": "## Python client for Gnetcli GRPC server\n\nGnetcli provides a universal way to execute arbitrary commands using a CLI,\neliminating the need for screen scraping with expect.\n\nSee documentation on [gnetcli server](https://annetutil.github.io/gnetcli/).\n\nExample:\n\n```python\nfrom gnetclisdk.client import Credentials, Gnetcli, HostParams\nimport os, asyncio\n\nasync def example():\n api = Gnetcli(insecure_grpc=True)\n # api = Gnetcli(insecure_grpc=True, auth_token=\"Basic \" + base64.b64encode(f\"{username}:{password}\".encode('utf-8')).decode(\"ascii\")\n dev_creds = Credentials(os.environ.get(\"LOGIN\"), os.environ.get(\"PASSWORD\"))\n res = await api.cmd(hostname=\"myhost\", cmd=\"dis clock\", host_params=HostParams(device=\"huawei\", credentials=dev_creds))\n print(\"err=%s status=%s out=%s\" % (res.error, res.status, res.out))\n\nasyncio.run(example())\n```\n\nOutput:\n```\nerr=b'' status=0 out=b'2023-11-10 09:31:58\\nFriday\\nTime Zone(UTC) : UTC'\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Client for Gnetcli GRPC-server",
"version": "1.0.101",
"project_urls": {
"Homepage": "https://github.com/annetutil/gnetcli"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2b110bcbcab407a772a93b30c1ea7b435156ba5abbe453a82d3af9e81e4d0969",
"md5": "31099c945e87fae9d4c9f3a2157cc519",
"sha256": "40292477926957fe9a203e8b34e549be7d5132873182cdf536c448b80013a967"
},
"downloads": -1,
"filename": "gnetclisdk-1.0.101-py3-none-any.whl",
"has_sig": false,
"md5_digest": "31099c945e87fae9d4c9f3a2157cc519",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 14668,
"upload_time": "2025-10-07T08:19:21",
"upload_time_iso_8601": "2025-10-07T08:19:21.882423Z",
"url": "https://files.pythonhosted.org/packages/2b/11/0bcbcab407a772a93b30c1ea7b435156ba5abbe453a82d3af9e81e4d0969/gnetclisdk-1.0.101-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7cd6e7ea6a6039fd83bac2b57fe7f5989700253f050a3d14981ecf938abff1b4",
"md5": "cceb8e9d3909a279377d9f097ff46583",
"sha256": "fe776c840f1f0cad18f31470d5e8fc1e7295a71d15bb3ac522119d39b399ce71"
},
"downloads": -1,
"filename": "gnetclisdk-1.0.101.tar.gz",
"has_sig": false,
"md5_digest": "cceb8e9d3909a279377d9f097ff46583",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13974,
"upload_time": "2025-10-07T08:19:22",
"upload_time_iso_8601": "2025-10-07T08:19:22.996994Z",
"url": "https://files.pythonhosted.org/packages/7c/d6/e7ea6a6039fd83bac2b57fe7f5989700253f050a3d14981ecf938abff1b4/gnetclisdk-1.0.101.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-07 08:19:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "annetutil",
"github_project": "gnetcli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gnetclisdk"
}