Skip to main content

Host list converter supporting hosts(5), ethers(5) and other formats

Project description

Build Status Version License Python versions dev status pypi monthly downloads

host list conveter supporting hosts(5), ethers(5) and other formats.

Python script which can convert different types of host or workstation lists. Refer to the Synopsis for currently supported input and output formats.

If you need support for another input/output format it should be pretty straight forward to add it.

Refer to the Makefile and the test_data for usage examples.


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]
           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
                        Regular expression checked against the input FQDNs. If
                        the regular expression matches, the FQDN will not be
  -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.


You can install hlc by invoking the following commands:

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 --accept-regex '^https://(test)?*\.whl.*'
current_release="$(find . -type f -name '*.whl' | sort | tail -n 1)"
gpg -v "${current_release}.asc" && pip3 install "${current_release}"

Refer to Verifying PyPI and Conda Packages for more details.

Or if you feel lazy and agree that pip/issues/1035 should be fixed you can also install hlc like this:

pip3 install hlc


Project details

Download files

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

Files for hlc, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size hlc-0.3.0-py3-none-any.whl (13.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size hlc-0.3.0.tar.gz (26.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page