Wednesday, May 8, 2013

Parsing with Parsimonious

Recently I've been playing around with a parsing library for Python called Parsimonious. So far, I've been very impressed with it. Examples can be a bit hard to find; the following is a simple CSV parser:


The resulting output is the following:
{'gender': 'male', 'age': '26', 'name': 'Bob'}
{'gender': 'female', 'age': '30', 'name': 'Kim'}
{'gender': 'male', 'name': 'Joe'}

2 comments: