pyparsing

raw JSON →
3.3.2 verified Tue May 12 auth: no python install: verified quickstart: verified

pyparsing is a Python library for defining and executing parsing grammars, currently at version 3.3.2, with a release cadence of regular updates.

pip install pyparsing
breaking Python versions before 3.9 are no longer supported; pyparsing now requires Python 3.9 or later.
fix Upgrade your Python version to 3.9 or later.
gotcha Ensure correct import paths to avoid ImportError.
fix Use 'from pyparsing import Word' instead of 'import pyparsing.Word'.
python os / libc status wheel install import disk
3.10 alpine (musl) - - 0.26s 18.7M
3.10 slim (glibc) - - 0.20s 19M
3.11 alpine (musl) - - 0.38s 20.7M
3.11 slim (glibc) - - 0.28s 21M
3.12 alpine (musl) - - 0.34s 12.5M
3.12 slim (glibc) - - 0.32s 13M
3.13 alpine (musl) - - 0.31s 12.2M
3.13 slim (glibc) - - 0.30s 13M
3.9 alpine (musl) - - 0.21s 18.2M
3.9 slim (glibc) - - 0.17s 19M

A simple example to parse a greeting using pyparsing.

from pyparsing import Word, alphas

greet = Word(alphas) + "," + Word(alphas) + "!"
hello = "Hello, World!"
print(hello, "->", greet.parse_string(hello))