Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A monadic parser combinator written purely in python

Project description

parsemon2

This is yet another attempt to bring monadic parsing to python. The problem the author saw with many other implementations is a limit to their composability. A lot of the times these otherwise quite well written implementations suffer pretty bad from pythons lack of TCO. This implementation uses trampolines to get around that.

Right now this implementation is nothing more but a toy, but the tests that come with this package show already that it’s parsing ability is not dependent on pythons recursion limit.

We also have error messages.

documentation

If you want to learn about the library we recommend checking out our readthedocs page.

Changes

3.0.1

  • Update README

3.0

  • Remove pyrsistent deque implementation
  • Improve fmap performance
  • Implement end-of-input parser
  • run_parser now returns a ParsingResult object instead of the raw value of the supplied parser
  • run_parser won’t fail if the parser did not consume all of the supplied input
  • Got rid of NotEnouhInput exception.
  • Drop official support for Python 3.6
  • Change semantics of until parser.

2.0

  • Parsers constructed with do can now take arguments
  • New parser for floating point numbers: parsmon.basic.floating_point
  • Implement x | y operator for parsers, it is a short hand for choice(x,y)
  • Improved performance parsing speed by factor 4 - 6
  • There is now an example of a parser included in this package. It is the worlds slowest json parser

1.1

  • Implement validators
  • chain now accepts 1 or more arguments
  • Implement do notation
  • New whitespace parser
  • New parser for integers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for parsemon2, version 3.0.1
Filename, size File type Python version Upload date Hashes
Filename, size parsemon2-3.0.1-py3-none-any.whl (28.1 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size parsemon2-3.0.1.tar.gz (43.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page