tfeldmann / simplematch

Minimal, super readable string pattern matching for python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Differences from parse

randallpittman opened this issue · comments

Hi! Great library. Seems quite similar to parse - are you familiar with that one? If so, what would you say differentiates the two?

Oh wow, did not know that one! Looks a bit more complicated, but very similar in some cases. I'll look into it and thank your for the hint!

Some differences I found.

simplematch

  • returns dict directly instead of <Result> classes
  • simpler, more readable syntax (ymmv)
  • less specific parsing functionality (misses some features like matching ints of specific length)
  • has uncaptured wildcards
  • less code
  • I'll guess it's faster. But I'd have to prove that.
  • global type registration

I somehow missed parse completely when I was developing this. So if you need some of the advanced functionality it looks like a great option. I think simplematch is a bit more intuitive to use, but I'm biased of course 😅