Collection of utilities for use across NSI projects.
pip3 install nsi
The nsi
library provides a number of utilities:
nsi.toolz
: Collection of general-purpose functions and types, patterned after thetoolz
functional programming library and can be used as a replacement for toolz (i.e. it imports everything fromtoolz.curried
orcytoolz.curred
ifcytoolz
is installed)nsi.yaml
: A few simple wrapper functions aroundruamel.yaml
that provides a standard interface for reading/writing YAML filesnsi.markdown
: Collection of Python Markdown extensionsMetaYamlExtension
(meta_yaml
): A slight tweak to the Meta-Data extension for providing YAML metadata at the beginning of a markdown fileSimpleTableExtension
(simpletable
): A<table>
-parsing extension for markdown that allows you to provide CSS classes for table elements within the markdownYamlDataExtension
(yaml_data
): A more general YAML-parsing extension that allows you to provide chunks of YAML data throughout the markdown file (not just at the beginning)
nsi.rest
: A ReST client-building tool that attempts to be more functionalnsi.logging
: Some logging utility functions that relies oncoloredlogs
for log coloringnsi.parallel
: Some functional parallelization utility functions designed for use within thetoolz
-ish functional idiomnsi.signature
: Functions to construct a host signature, for use when "fingerprinting" clients is necessarynsi.shell
: Shell command functions
The library also provides the following command-line tools:
diffips
: Given two files with IPs (A and B), get difference A - Bintips
: Given two files with IPs (A and B), get intersection A & Bdifflines
: Given two files with lines of text (A and B), get difference A - Bintlines
: Given two files with lines of text (A and B), get intersection A & Bsortips
: Given text content (from clipboard, file, or stdin), extract IPs sort themgetips
: Given text content (from clipboard, file, or stdin), extract IPs and print them