Flexparser is a Python library that enables parsing of string-based data into complex Python objects using type hints. Inspired by Pydantic, it leverages `typing` module annotations to define target data structures. Currently at version 0.4, its release cadence is infrequent but maintained.
pip install flexparserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `flexparser.parse_string` to parse a YAML-like string into a Python dictionary, leveraging type hints for schema definition. The `target_type` argument tells `flexparser` what structure to expect, which it infers from the return annotation of `parse_config_data`.
Refer to the GitHub repository for the latest API documentation and examples. Pin exact minor versions in your `requirements.txt` to prevent unexpected breaks (e.g., `flexparser==0.4`).
Stick to standard Python types (e.g., `str`, `int`, `float`, `bool`, `List`, `Dict`, `Tuple`, `Union`) for best compatibility. For custom types, consult the source code or experiment with simple examples first to understand current capabilities.
Test parsing with incremental complexity. Use smaller input snippets to isolate issues. For critical data, consider adding preliminary input validation before parsing to catch common structural errors earlier.
No dependency data recorded yet.