Archives
- July 2010
- May 2010
- April 2010
- February 2010
- December 2009
- November 2009
- July 2008
- May 2008
- April 2008
- January 2008
- December 2007
- November 2007
- March 2007
- January 2007
- October 2006
- September 2006
- August 2006
- June 2006
- May 2006
- April 2006
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- April 2005
- February 2005
- January 2005
- December 2004
- April 2003
Python’s simpleparse module
I’m working on a project that required a bit more from the JSON parser than the stock JSON parser with Python allowed for. After doing some hunting around, I came to the unfortunate conclusion that I’d probably need to write my own.
Thankfully, Python’s simpleparse module lived up to its billing (thanks in large part to JSON having such trivial syntax) Here’s the working BNF suitable for passing to simpleparse:
This is also available in source code form here: jsonorder.py. jsonorder.py is part of a larger project, but it also works as a standalone library (albeit not a terribly useful one for most uses)