Skip to main content

Client for Gnetcli GRPC-server

Project description

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.

Example:

from gnetclisdk.client import Credentials, Gnetcli
import os, asyncio

async def example():
    api = Gnetcli(insecure_grpc=True)
    dev_creds = Credentials(os.environ.get("LOGIN"), os.environ.get("PASSWORD"))
    res = await api.cmd(hostname="myhost", device="huawei", cmd="dis clock", 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'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gnetclisdk-1.0.41.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

gnetclisdk-1.0.41-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file gnetclisdk-1.0.41.tar.gz.

File metadata

  • Download URL: gnetclisdk-1.0.41.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gnetclisdk-1.0.41.tar.gz
Algorithm Hash digest
SHA256 fe6a4fdd4018f3e31391265a83c914764e966990fb6f830e78898c383a36c793
MD5 07a15fd4e63ff2273cbc9739a7da19f8
BLAKE2b-256 78cb627ce85787f8132bd476c9839e245fe6daacf7c8c095e7ee0e7b62a0202c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gnetclisdk-1.0.41.tar.gz:

Publisher: publish-to-pypi.yml on annetutil/gnetcli

Attestations:

File details

Details for the file gnetclisdk-1.0.41-py3-none-any.whl.

File metadata

  • Download URL: gnetclisdk-1.0.41-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for gnetclisdk-1.0.41-py3-none-any.whl
Algorithm Hash digest
SHA256 c93fb1f938734ed2930c061708630aff3d5f6bafe024f149844ff975f7875ba6
MD5 bdf088b3c4a48135c18c8bb5bd93d55c
BLAKE2b-256 3e451f30e91ac9220b1266e379cf25c70d24bd4b91ddc33da0492b97423a6f57

See more details on using hashes here.

Provenance

The following attestation bundles were made for gnetclisdk-1.0.41-py3-none-any.whl:

Publisher: publish-to-pypi.yml on annetutil/gnetcli

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page