Skip to main content

c# pyats_parser This library is a workaround to use PyATS parser libraries outside PyATS workflow which consist of declaring devices in a testbed and connect to device with pyATS, execute command with pyATS and finally parse output.

With pyats_parser you just have to fill the cli return collected by NSO live status, netmiko , etc...

Installation

pip install pyats-parser

Usage

from pyats_parser import parser

show_version = """
RP/0/RSP0/CPU0:MY-DEVICE#show version
Thu Jun 24 14:25:48.716 CEST
Cisco IOS XR Software, Version 7.1.15
Copyright (c) 2013-2020 by Cisco Systems, Inc.

Build Information:
 Built By     : bob
 Built On     : Wed Apr 29 12:55:55 PDT 2020
 Built Host   : iox-ucs-032
 Workspace    : /auto/srcarchive11/prod/7.1.15/asr9k-x64/ws
 Version      : 7.1.15
 Location     : /opt/cisco/XR/packages/
 Label        : 7.1.15

cisco ASR9K () processor
System uptime is 1 year 6 weeks 5 days 18 hours 42 minutes

RP/0/RSP0/CPU0:MY-DEVICE#
"""

result = parser.parse(show_version,"show version","iosxr")

And you will get the structured output as a dictionary :

{'operating_system': 'IOSXR', 
 'software_version': '7.1.15', 
 'device_family': 'ASR9K',
 'uptime': '1 year 6 weeks 5 days 18 hours 42 minutes'}

This library is inspired from : https://github.com/CiscoDevNet/ansible-pyats/blob/master/library/pyats_parse_command.py

License

This project is licensed to you under the terms of the Cisco Sample Code License.

Metadata

Release files for pyats-parser 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pyats-parser 1.0.7
File Interpreter ABI Platform
pyats_parser-1.0.7-py3-none-any.whl Python 3 none any Details

Release files / pyats_parser-1.0.7-py3-none-any.whl

Download URL pyats_parser-1.0.7-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76245d859cd7dd62c499ff5e27ed1e54bbab92711b084f4ff2043a21366f2e99
BLAKE2b-256 checksum
How to use checksums
68fd9e59d077b1eebc9603b454a0420edee771e25c8974c536f9666b0f74047c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.7 This release

1 release file

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page