支持主机(5)、以太网(5)和其他格式的宿主列表转换器
项目描述
host list conveter支持主机(5)、以太网(5)和其他格式。
Python脚本,可转换不同类型的宿主或工作站列表。有关当前支持的输入和输出格式,请参阅摘要。
如果您需要支持其他输入/输出格式,添加它应该非常简单。
摘要
usage: hlc [-h] [-V] [-d] [-v] [-q]
[-f {paedml_linux,json,ms_dhcp,linuxmuster_net}] [-o OUTPUT_FILE]
[-t {paedml_linux,json,ethers,hosts}] [-e EXTRA_VARS]
[-I IGNORE_FQDN_REGEX] [-r RENAME_CSV_FILE]
input_file [input_file ...]
The host list converter (hlc).
positional arguments:
input_file File path to the input file to process. '-' will read
from STDIN.
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-d, --debug Write debugging and higher to STDOUT|STDERR.
-v, --verbose Write information and higher to STDOUT|STDERR.
-q, --quiet, --silent
Only write errors and higher to STDOUT|STDERR.
-f {paedml_linux,json,ms_dhcp,linuxmuster_net}, --input-format {paedml_linux,json,ms_dhcp,linuxmuster_net}, --from {paedml_linux,json,ms_dhcp,linuxmuster_net}
Format of the input file. Default: json.
-o OUTPUT_FILE, --output-file OUTPUT_FILE
Where to write the output file. '-' will read from
STDIN. If not given, no final output will be produced.
-t {paedml_linux,json,ethers,hosts}, --output-format {paedml_linux,json,ethers,hosts}, --to {paedml_linux,json,ethers,hosts}
Format of the output file. Default: json.
-e EXTRA_VARS, --extra-vars EXTRA_VARS
Set additional variables as key=value to change the
behavior of how different input/output formats are
processed.
-I IGNORE_FQDN_REGEX, --ignore-fqdn-regex IGNORE_FQDN_REGEX
Regular expression checked against the input FQDNs. If
the regular expression matches, the FQDN will not be
exported.
-r RENAME_CSV_FILE, --rename-csv-file RENAME_CSV_FILE
Allows you to do mass rename via a provided CSV file.
It is based on substation using regular expressions.
The first column is a case insensitive search pattern,
the second one the replacement string.
安装
您可以通过以下命令安装hlc:
gpg --recv-keys 'C505 B5C9 3B0D B3D3 38A1 B600 5FE9 2C12 EE88 E1F0'
mkdir --parent /tmp/hlc && cd /tmp/hlc
wget -r -nd -l 1 https://pypi.python.org/pypi/hlc --accept-regex '^https://(test)?pypi.python.org/packages/.*\.whl.*'
current_release="$(find . -type f -name '*.whl' | sort | tail -n 1)"
gpg -v "${current_release}.asc" && pip3 install "${current_release}"
有关更多详细信息,请参阅验证PyPI和Conda包。
或者,如果您觉得懒惰并且同意pip的问题/1035应该得到修复,您也可以这样安装hlc:
pip3 install hlc
取代
许可证
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源代码分布
hlc-0.3.0.tar.gz (26.8 kB 查看哈希值)
构建分布
hlc-0.3.0-py3-none-any.whl (13.4 kB 查看哈希值)
关闭
hlc-0.3.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 3c31cb8807078479913a15ea82ce743f45aba8ef67a4ae4b44aee60369b1bf8f |
|
MD5 | 774f5d738b162eca012ae6eb13b99acc |
|
BLAKE2b-256 | 72846b9eb772843b1302ae3d71baf21bcb2cfedc172d190e24893ed378f29c75 |
关闭
hlc-0.3.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 65bb7a64abf23c3e36b7a51247f884e2f24e333fee657b1c27571106b03d00d3 |
|
MD5 | 2347b76a185c85097d6f842966a6f16f |
|
BLAKE2b-256 | c9a4b96126b9a9285945e0bd2592670674a199df3be88244bfb7c58d75a7b311 |