skillfed

ttp_templates

Template Text Parser Templates collections

ttp-templates v0.5.9 224.4K downloads/30d#9,233 on PyPI71
Permissive license MIT Active released

What it is and what it does

ttp_templates is a library of pre-built parsing templates for TTP, a text parsing engine designed to extract structured data from unstructured or semi-structured text. It ships with templates tailored for network device outputs (Cisco IOS, etc.) and can map parsed results to YANG data models like ietf-interfaces. You use it by calling parse_output() with device output and platform/command metadata, or by retrieving specific templates via get_template() and passing them to the TTP parser directly.

The package depends on ttp for the actual parsing engine and pydantic for data validation. It targets Python 3.10 and later and requires no system libraries or external tools. The templates are community-contributed and cover common network operational commands; if you have a parsing problem that fits an existing template, this package saves you from writing regex and TTP grammar from scratch.

Use it for:

  • Parse Cisco IOS 'show' command output into structured dictionaries for automation or inventory tools.
  • Convert network device configurations into YANG-compliant JSON for standards-based tooling.
  • Extract interface, routing, or VLAN data from device CLI output without writing custom parsers.
  • Validate and normalize parsed network state across multiple device types using pre-tested templates.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a curated collection of TTP (Template Text Parser) templates for parsing structured text output from network devices and other systems into validated Python data structures.

Yes. Low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. Install if you parse network device output or other semi-structured text and want to avoid writing TTP templates from scratch. Skip if you have no use for TTP or need templates for platforms not yet in the collection.

Install

ttp-templates on PyPI

pip

pip install ttp-templates

uv

uv add ttp-templates

poetry

poetry add ttp-templates

Installing ttp_templates

Before you install

Low friction: pure Python wheel with only two runtime dependencies (ttp and pydantic). Last release 33 days ago with active maintenance and 71 repository stars.

License in practice

MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements.

Quickstart

pip install ttp-templates

from ttp_templates import parse_output

result = parse_output(
    data="interface GigabitEthernet1/3.251\n description Customer #32148\n ip address 172.16.33.10 255.255.255.128",
    platform="Test Platform",
    command="show run | sec interface"
)
print(result)

Requires Python 3.10 or later; TTP must be installed (automatic via pip).

Verify before relying

  • Whether templates cover specific network platforms or command outputs beyond the Cisco IOS examples shown.
  • How frequently new templates are added and the process for community contributions.

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — ttp, pydantic
Maintenance actively maintained — 33 days since the last release
Last repo commit
First released
Downloads 224,359/month — #9,233 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: ttp_templates-0.5.9-py3-none-any.whl

Keywords: Parsing, TTP, regex

License :: OSI Approved :: MIT LicenseOperating System :: POSIX :: LinuxProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Utilities

Tags

network device output parsingttp templates collectiontext parsing templatescisco ios parsingstructured text extractionyang model templatesnetwork config parsing
network-parsingtemplate-library

More Utilities packages