--- id: stringparser version: "0.7" license: BSD-3-Clause license_treatment: permissive maintenance: dormant --- # stringparser — Easy to use pattern matching and information extraction License: permissive · Maintenance: dormant · Downloads: 193.2K/mo ## What it is and what it does stringparser provides a lightweight alternative to regular expressions for extracting structured data from strings. Instead of writing regex patterns, you write format strings using the familiar PEP 3101 syntax (the same format used by Python's str.format() method). The Parser class matches a string against a pattern and returns extracted values as scalars, lists, OrderedDicts, or nested objects depending on how you name and structure the fields. The library is intentionally simpler than regex—it matches from beginning to end and supports only a subset of format string features (type specifiers, sign, and the # flag). This makes it ideal for parsing structured text with known layouts, such as log lines, configuration values, or simple tabular data, where regex would be overkill but string splitting is too fragile. Use it for: - Parse log lines with a known format to extract timestamps, levels, or message content. - Extract key-value pairs from structured text without writing regex patterns. - Build reusable parsers for configuration files or data exports with consistent formatting. - Extract and map fields into object attributes for lightweight data binding. - Parse simple tabular or columnar text where format is predictable. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Extracts values from strings using format-string patterns instead of regular expressions, supporting simple field extraction, ordering, and nested object assignment. Yes, if you need lightweight pattern matching on structured text and want to avoid regex complexity. The low install friction, permissive license, and stable API make it a reasonable choice for parsing tasks with known, simple formats. However, the dormant maintenance status means you should verify that the feature set covers your use case before committing to it, and be prepared to maintain a fork if critical issues arise. ## Install pip install stringparser uv add stringparser poetry add stringparser ## Installing stringparser Before you install: Low friction: pure Python wheel with a single runtime dependency (typing-extensions). Dormant maintenance status since last commit 2023-11-16, but no recent activity suggests stability rather than active development. License in practice: BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: from stringparser import Parser parser = Parser('The answer is {:d}') result = parser('The answer is 42') print(result) # Output: 42 Requires Python 3.9 or later. Verify before relying: - Whether dormant maintenance status indicates ongoing stability or de facto abandonment risk. - Performance characteristics compared to regex for large-scale parsing tasks. - Whether all format string spec features needed for your use case are implemented (only type, sign, and # are currently supported). ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 193.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags string pattern matching without regex, extract values from formatted strings, PEP 3101 format string parsing, simple string parsing library, format string pattern extraction, string-parsing, format-strings, data-extraction [View on SkillFed](https://skillfed.io/packages/stringparser) · [View on PyPI](https://pypi.org/project/stringparser/)