## 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/98/ab/5f71978ca4fb82b81be6ba262e591e90973790d34bfcffdd0acf94f3e054/gnetclisdk-1.0.100.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.100",
"project_urls": {
"Homepage": "https://github.com/annetutil/gnetcli"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "622acc786e2f0f0cd1d5188148ee9bb899e5b8e9069e25b3d4c7956b21662c4f",
"md5": "7f62ec3a701acc244a6ed1b216decd30",
"sha256": "f0508e646615cdb008c3fef99013d4e127f169c186b9dc672a607d346cfe6ecc"
},
"downloads": -1,
"filename": "gnetclisdk-1.0.100-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f62ec3a701acc244a6ed1b216decd30",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 14620,
"upload_time": "2025-09-16T19:33:33",
"upload_time_iso_8601": "2025-09-16T19:33:33.985643Z",
"url": "https://files.pythonhosted.org/packages/62/2a/cc786e2f0f0cd1d5188148ee9bb899e5b8e9069e25b3d4c7956b21662c4f/gnetclisdk-1.0.100-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "98ab5f71978ca4fb82b81be6ba262e591e90973790d34bfcffdd0acf94f3e054",
"md5": "79bdd2015d414d11c6487709d256447b",
"sha256": "3cd2f9fccfa6fa0c385fb2fe8a8f98ffe373af25fc391b9c9aff7e61d6cdc4dd"
},
"downloads": -1,
"filename": "gnetclisdk-1.0.100.tar.gz",
"has_sig": false,
"md5_digest": "79bdd2015d414d11c6487709d256447b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13912,
"upload_time": "2025-09-16T19:33:35",
"upload_time_iso_8601": "2025-09-16T19:33:35.389163Z",
"url": "https://files.pythonhosted.org/packages/98/ab/5f71978ca4fb82b81be6ba262e591e90973790d34bfcffdd0acf94f3e054/gnetclisdk-1.0.100.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-16 19:33:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "annetutil",
"github_project": "gnetcli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gnetclisdk"
}