textproc/py-ntc-templates: New port
The NTC templates project provides a large collection of TextFSM Templates (text parsers) for a variety of Networking Vendors. In addition to the templates, there is a function that will convert the CLI output into a CliTable object; the resulting text table is converted into a list of dictionaries mapping the column headers with each row in the table. WWW: https://github.com/networktocode/ntc-templates
This commit is contained in:
parent
2df6f6207d
commit
35f92ba20e
5 changed files with 71 additions and 0 deletions
|
@ -1377,6 +1377,7 @@
|
|||
SUBDIR += py-nbsphinx
|
||||
SUBDIR += py-nltk
|
||||
SUBDIR += py-normality
|
||||
SUBDIR += py-ntc-templates
|
||||
SUBDIR += py-numpydoc
|
||||
SUBDIR += py-ocrmypdf
|
||||
SUBDIR += py-openpyxl
|
||||
|
|
30
textproc/py-ntc-templates/Makefile
Normal file
30
textproc/py-ntc-templates/Makefile
Normal file
|
@ -0,0 +1,30 @@
|
|||
PORTNAME= ntc-templates
|
||||
DISTVERSIONPREFIX= v
|
||||
DISTVERSION= 3.0.0
|
||||
CATEGORIES= textproc net-mgmt python
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
||||
MAINTAINER= kai@FreeBSD.org
|
||||
COMMENT= TextFSM Templates for Network Devices
|
||||
|
||||
LICENSE= APACHE20
|
||||
LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||
|
||||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}textfsm>=1.1.0<2.0.0:textproc/py-textfsm@${PY_FLAVOR}
|
||||
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
|
||||
${PYTHON_PKGNAMEPREFIX}ruamel.yaml>0:devel/py-ruamel.yaml@${PY_FLAVOR} \
|
||||
${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR}
|
||||
|
||||
USES= python:3.6+
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= networktocode
|
||||
USE_PYTHON= autoplist distutils
|
||||
|
||||
TEST_ENV= PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
|
||||
|
||||
NO_ARCH= yes
|
||||
|
||||
do-test:
|
||||
@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs
|
||||
|
||||
.include <bsd.port.mk>
|
3
textproc/py-ntc-templates/distinfo
Normal file
3
textproc/py-ntc-templates/distinfo
Normal file
|
@ -0,0 +1,3 @@
|
|||
TIMESTAMP = 1648157996
|
||||
SHA256 (networktocode-ntc-templates-v3.0.0_GH0.tar.gz) = d5f1148926b1b7a5929ac4896dfa6712bef840d2fb33710fbe6fe505c9f34a6f
|
||||
SIZE (networktocode-ntc-templates-v3.0.0_GH0.tar.gz) = 752785
|
29
textproc/py-ntc-templates/files/patch-setup.py
Normal file
29
textproc/py-ntc-templates/files/patch-setup.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
--- setup.py.orig 2022-03-27 21:10:43 UTC
|
||||
+++ setup.py
|
||||
@@ -0,0 +1,26 @@
|
||||
+# -*- coding: utf-8 -*-
|
||||
+from setuptools import setup
|
||||
+
|
||||
+packages = \
|
||||
+['ntc_templates']
|
||||
+
|
||||
+package_data = \
|
||||
+{'': ['*'], 'ntc_templates': ['templates/*']}
|
||||
+
|
||||
+install_requires = \
|
||||
+['textfsm>=1.1.0,<2.0.0']
|
||||
+
|
||||
+setup_kwargs = {
|
||||
+ 'name': 'ntc-templates',
|
||||
+ 'version': '3.0.0',
|
||||
+ 'description': "TextFSM Templates for Network Devices, and Python wrapper for TextFSM's CliTable.",
|
||||
+ 'author': 'Network to Code',
|
||||
+ 'author_email': 'info@networktocode.com',
|
||||
+ 'url': 'https://github.com/networktocode/ntc-templates',
|
||||
+ 'packages': packages,
|
||||
+ 'package_data': package_data,
|
||||
+ 'install_requires': install_requires,
|
||||
+ 'python_requires': '>=3.6,<4.0',
|
||||
+}
|
||||
+
|
||||
+setup(**setup_kwargs)
|
8
textproc/py-ntc-templates/pkg-descr
Normal file
8
textproc/py-ntc-templates/pkg-descr
Normal file
|
@ -0,0 +1,8 @@
|
|||
The NTC templates project provides a large collection of TextFSM Templates
|
||||
(text parsers) for a variety of Networking Vendors.
|
||||
|
||||
In addition to the templates, there is a function that will convert the CLI
|
||||
output into a CliTable object; the resulting text table is converted into a
|
||||
list of dictionaries mapping the column headers with each row in the table.
|
||||
|
||||
WWW: https://github.com/networktocode/ntc-templates
|
Loading…
Reference in a new issue