axlib 1.0.7
Pages and sections ↓

Text-filter samples#

These files were supplied with the early text-filter modules and are retained as hands-on inputs outside the installable package source.

text.test    #, ;, !, and // comments, quoted values, triple-quoted notes,
             blank and whitespace-only lines, and Python, JSON, INI, and CSV
text.md      Python-style text whose docstrings contain comment-like lines
text.white   tabs, repeated spaces, quoted regions, escaped quotes, and an
             unclosed quote
text.toml    TOML with # and ; inside quoted strings
text.yaml    indented YAML with quoted values and inline comments

Try them from the repository root with commands such as the ones below. In a development checkout, run uv sync once and put uv run before each python.

python -m axlib.tf comments examples/text/text.test
python -m axlib.tf whitespace-safe examples/text/text.yaml
python -m axlib.tf comments examples/text/text.toml
python -m axlib.tf whitespace examples/text/text.white
python -m axlib.tf triple-quotes examples/text/text.md \
  | python -m axlib.tf slash-comments \
  | python -m axlib.tf comments

What to look for:

Notes inside the samples, such as remove this or protected, are labels for the reader; docs/TEXT_FILTERS.md describes what each filter actually does.

Review each transformation before using the result as input to a deployment system. The filters intentionally operate on text and do not validate a network vendor's configuration grammar.