aiognmi


Nameaiognmi JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryAsync, efficient and lightweight gNMI client written in Python.
upload_time2024-03-30 11:47:53
maintainerNone
docs_urlNone
authorArtem Kotik
requires_python>=3.10
licenseMIT License Copyright (c) 2023 Artem Kotik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords automation network network-automation gnmi gnmi-client grpc grpc-python async python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/miaow2/aiognmi/actions/workflows/commit.yaml/badge.svg?branch=main)](https://github.com/miaow2/aiognmi/actions)

# aiogNMI

## About

This Python library provides an efficient and lightweight gNMI client implementation that leverages asynchronous approach.

### Supported RPCs:

* Capabilities
* Get
* Set
* Subscribe (under development)

### Tested on:

* Arista EOS
* Nokia SR OS

Repository contains protobuf files from [gNMI](https://github.com/openconfig/gnmi/tree/master/proto) repo and based on gNMI release v0.10.0.
 Early gNMI version should work too, I've tested with 0.7.0 and it works well.

> **_NOTE:_**  At this moment supporting of the secure connections (with encryption or certificate) is in alpha version. You can use them, but I don't guarantee stable work.

## Install

Install with pip:

```bash
pip install aiognmi
```

## Examples

`Capabilities` RPC

```python
import asyncio

from aiognmi import AsyncgNMIClient


async def main():
    async with AsyncgNMIClient(host="test-1", port=6030, username="admin", password="admin", insecure=True) as client:
        resp = await client.get_capabilities()

    print(resp.result)


if __name__ == "__main__":
    asyncio.run(main())
```

`Get` RPC

```python
import asyncio

from aiognmi import AsyncgNMIClient


async def main():
    async with AsyncgNMIClient(host="test-1", port=6030, username="admin", password="admin", insecure=True) as client:
        resp = await client.get(
            paths=[
                "/interfaces/interface[name=Management0]",
            ]
        )

    print(resp.result)


if __name__ == "__main__":
    asyncio.run(main())
```

`Set` RPC

```python
import asyncio

from aiognmi import AsyncgNMIClient


async def main():
    async with AsyncgNMIClient(host="test-1", port=6030, username="admin", password="admin", insecure=True) as client:
        resp = await client.set(
            update=[
                {"path": "/interfaces/interface[name=Management0]/config", "data": {"description": "gnmi update test"}}
            ]
        )

    print(resp.result)


if __name__ == "__main__":
    asyncio.run(main())
```

## Credits

My work is inspired by these people:

1. [Anton Karneliuk](https://github.com/akarneliuk) and his [pyGNMI](https://github.com/akarneliuk/pygnmi) library
2. [Carl Montanari](https://github.com/carlmontanari) and his [scrapli](https://github.com/carlmontanari/scrapli) library

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "aiognmi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "automation, network, network-automation, gnmi, gnmi-client, grpc, grpc-python, async, python",
    "author": "Artem Kotik",
    "author_email": "miaow2@yandex.ru",
    "download_url": "https://files.pythonhosted.org/packages/b3/2c/46212b7b64eece8c58419c83453139e175ae974fc7dcc87c948c367dd788/aiognmi-0.1.1.tar.gz",
    "platform": null,
    "description": "[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/miaow2/aiognmi/actions/workflows/commit.yaml/badge.svg?branch=main)](https://github.com/miaow2/aiognmi/actions)\n\n# aiogNMI\n\n## About\n\nThis Python library provides an efficient and lightweight gNMI client implementation that leverages asynchronous approach.\n\n### Supported RPCs:\n\n* Capabilities\n* Get\n* Set\n* Subscribe (under development)\n\n### Tested on:\n\n* Arista EOS\n* Nokia SR OS\n\nRepository contains protobuf files from [gNMI](https://github.com/openconfig/gnmi/tree/master/proto) repo and based on gNMI release v0.10.0.\n Early gNMI version should work too, I've tested with 0.7.0 and it works well.\n\n> **_NOTE:_**  At this moment supporting of the secure connections (with encryption or certificate) is in alpha version. You can use them, but I don't guarantee stable work.\n\n## Install\n\nInstall with pip:\n\n```bash\npip install aiognmi\n```\n\n## Examples\n\n`Capabilities` RPC\n\n```python\nimport asyncio\n\nfrom aiognmi import AsyncgNMIClient\n\n\nasync def main():\n    async with AsyncgNMIClient(host=\"test-1\", port=6030, username=\"admin\", password=\"admin\", insecure=True) as client:\n        resp = await client.get_capabilities()\n\n    print(resp.result)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n`Get` RPC\n\n```python\nimport asyncio\n\nfrom aiognmi import AsyncgNMIClient\n\n\nasync def main():\n    async with AsyncgNMIClient(host=\"test-1\", port=6030, username=\"admin\", password=\"admin\", insecure=True) as client:\n        resp = await client.get(\n            paths=[\n                \"/interfaces/interface[name=Management0]\",\n            ]\n        )\n\n    print(resp.result)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n`Set` RPC\n\n```python\nimport asyncio\n\nfrom aiognmi import AsyncgNMIClient\n\n\nasync def main():\n    async with AsyncgNMIClient(host=\"test-1\", port=6030, username=\"admin\", password=\"admin\", insecure=True) as client:\n        resp = await client.set(\n            update=[\n                {\"path\": \"/interfaces/interface[name=Management0]/config\", \"data\": {\"description\": \"gnmi update test\"}}\n            ]\n        )\n\n    print(resp.result)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Credits\n\nMy work is inspired by these people:\n\n1. [Anton Karneliuk](https://github.com/akarneliuk) and his [pyGNMI](https://github.com/akarneliuk/pygnmi) library\n2. [Carl Montanari](https://github.com/carlmontanari) and his [scrapli](https://github.com/carlmontanari/scrapli) library\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Artem Kotik  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Async, efficient and lightweight gNMI client written in Python.",
    "version": "0.1.1",
    "project_urls": {
        "homepage": "https://github.com/miaow2/aiognmi/",
        "repository": "https://github.com/miaow2/aiognmi/"
    },
    "split_keywords": [
        "automation",
        " network",
        " network-automation",
        " gnmi",
        " gnmi-client",
        " grpc",
        " grpc-python",
        " async",
        " python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "09fbf7e32c0140c3a5f3420f7fede984e00c83ef80455f50088b9887740a8247",
                "md5": "b41c03d615d1992a4981a6790f6fca4d",
                "sha256": "be6bc87d20f607f80a69d3616f346d903e45199f538d1273700fb5ddef810977"
            },
            "downloads": -1,
            "filename": "aiognmi-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b41c03d615d1992a4981a6790f6fca4d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 18102,
            "upload_time": "2024-03-30T11:47:51",
            "upload_time_iso_8601": "2024-03-30T11:47:51.974670Z",
            "url": "https://files.pythonhosted.org/packages/09/fb/f7e32c0140c3a5f3420f7fede984e00c83ef80455f50088b9887740a8247/aiognmi-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b32c46212b7b64eece8c58419c83453139e175ae974fc7dcc87c948c367dd788",
                "md5": "d847da9c3ef2a176e7937e353ddeb5fb",
                "sha256": "080a3b8f8072688c8499d639a9302500a741fd78418385f9bb35e6f8858b26d1"
            },
            "downloads": -1,
            "filename": "aiognmi-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d847da9c3ef2a176e7937e353ddeb5fb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 17106,
            "upload_time": "2024-03-30T11:47:53",
            "upload_time_iso_8601": "2024-03-30T11:47:53.771304Z",
            "url": "https://files.pythonhosted.org/packages/b3/2c/46212b7b64eece8c58419c83453139e175ae974fc7dcc87c948c367dd788/aiognmi-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-30 11:47:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "miaow2",
    "github_project": "aiognmi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiognmi"
}
        
Elapsed time: 0.28819s