Parsm - an Everything Parser

Posted on Sun 29 June 2025 in tech

Introducing Parsm: A Universal Structured Text Parser

Eat More Cookie

When scientists and engineers created the UNIX system, they built utilities that each performed a specific task exceptionally well. Commands such as grep, awk, and sed have become the atoms of text and data processing workflows. However, today's computing landscape is dominated by structured data formats like JSON, YAML, CSV, and TOML. In that context, many of these powerful utilities are less important.

Recognizing this, I've developed parsm: a parser specifically designed for the structured-data-rich era we inhabit today. Parsm is better at understanding structured text than grep or sed while providing a more straightforward domain specific language with field selection than awk.

What is Parsm?

Parsm is an "everything parser," a robust command-line utility explicitly engineered to handle multiple structured text formats seamlessly. Unlike traditional tools (grep, awk, sed), which primarily handle line-based text, parsm inherently understands structured data—automatically parsing JSON, YAML, TOML, CSV, and logfmt formats. Parsm can even parse words from sentencences.

Why Parsm?

Parsm simplifies workflows dramatically by intelligently detecting input formats and providing intuitive filtering and templating functionalities. Parsm also works great in traditional UNIX style pipelined data streams.

For example, here's how easily you can use parsm:

Parsing and filtering JSON data:

$ echo '[{"name": "Alice", "age": 30},{"name": "Bob"}]' | parsm 'name'
Alice
Bob

Filtering CSV data:

$ echo Alice,30,Engineer | ./target/debug/parsm 'field_0 ^= "A" {$field_0 is an $field_2}'
Alice is an Engineer

Extracting from logfmt:

$ echo 'level=info msg="Service started"' | parsm 'msg'
Service started

Key Features

  • Automatic format detection: Recognizes data formats instantly, minimizing setup.
  • Unified syntax: One intuitive syntax across all supported formats.
  • Powerful templating and filtering: Effortlessly extract, filter, transform, and format data.

Getting Started

Install parsm easily using Cargo:

cargo install parsm

Explore and contribute to the project:

GitHub Repository

Crates IO

Closing Thoughts

Parsm isn't about reinventing Unix utilities—it's about evolving them. With a nod to structured data and its main workflow, field selection, Parsm provides powerful and efficient way to interact with modern data. It's the Unix way adapted for your needs today.