--- id: ttp version: "0.10.1" license: MIT license_treatment: permissive maintenance: active --- # ttp — Template Text Parser License: permissive · Maintenance: active · Downloads: 479.6K/mo ## What it is and what it does TTP is a template-driven text parser that converts unstructured or semi-structured text into hierarchical structured data. It works by dynamically generating regexes from user-defined templates with placeholder syntax, then matching and extracting data from input text. The library includes built-in functions for processing matches on-the-fly, combining results into arbitrary hierarchies, and formatting output for storage or further processing. The package is designed for scenarios where raw text output—such as network device configurations, command outputs, or log files—needs to be transformed into machine-readable formats. It handles multi-level nesting, lookups across parsing groups, and output formatting (including tabular display), making it particularly suited for network automation and data extraction tasks where regex alone would be tedious to maintain. Use it for: - Parse network device configuration and state outputs (BGP, interfaces, routing) into structured JSON or dictionaries for automation workflows. - Extract and combine data from multiple command outputs by correlating results across parsing groups using lookup functions. - Transform unstructured log files or text reports into tabular or hierarchical formats for analysis or storage in databases. - Build reusable parsing templates for repetitive text extraction tasks without writing custom regex code for each variation. - Process CLI output from infrastructure tools to feed structured data into downstream systems or APIs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. TTP is a Python library for parsing semi-structured text into structured data using template-based regex matching, with built-in functions for processing and transforming results. Yes. TTP is worth installing for any project requiring semi-structured text parsing. It has zero runtime dependencies, low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. The template-based approach reduces boilerplate compared to hand-written regex, and the library's built-in processing functions handle common transformation tasks. Best fit for network automation, log parsing, and configuration extraction workflows. ## Install pip install ttp uv add ttp poetry add ttp ## Installing ttp Before you install: Low install friction with no runtime dependencies. Actively maintained with recent releases; last commit 2026-03-24 and 393 repository stars indicate ongoing development. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal attribution requirements. Quickstart: from ttp import ttp data = "interface Loopback0\n ip address 192.168.0.113/24" template = "interface {{ interface }}\n ip address {{ ip }}/{{ mask }}" parser = ttp(data, template) parser.parse() result = parser.result() Requires Python 3.9 or later (supports 3.9 through 3.14). Verify before relying: - Performance characteristics with large text inputs or complex template hierarchies - Comparison of template syntax learning curve relative to other parsing libraries - Availability and maturity of the community template collection referenced in documentation ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 479.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags semi-structured text parsing, template-based regex parsing, text to structured data, network config parsing, dynamic regex templates, text data extraction, parsing with templates, text-extraction, network-automation, template-parsing [View on SkillFed](https://skillfed.io/packages/ttp) · [View on PyPI](https://pypi.org/project/ttp/)