Skip to content

InfinityParse

Type-safe, scanf-style string parsing for Python.

InfinityParse maps each {} placeholder to one converter type: in scan[int, float]("{} {}") the type arguments declare how fields are converted; call the parser with an input string and get a strongly-typed tuple back. Zero runtime dependencies, Python 3.14+ (PEP 695 generics).

Installation

# uv (recommended)
uv add infinity_parse

# or pip
pip install infinity_parse

Minimal Example

from infinity_parse import scan

a, b, c = scan[int, float, str]("{} {} {}")("1 2.5 hello")
# a=1 (int), b=2.5 (float), c="hello" (str)