Skip to main content

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 (in progress)

  • 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.

Source Distribution

parsemon2-3.0.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

parsemon2-3.0-py3-none-any.whl (28.1 kB view details)

Uploaded Python 3

File details

Details for the file parsemon2-3.0.tar.gz.

File metadata

  • Download URL: parsemon2-3.0.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5

File hashes

Hashes for parsemon2-3.0.tar.gz
Algorithm Hash digest
SHA256 97d34f03864c30a451dfea9b81c75751f8923c779c0a29a0e04110dad4f62776
MD5 fb7e61cbedd70922742288b54d3e7375
BLAKE2b-256 677a8d6cfe0e1bd5c72e4bd61148cefa59de3221e5cea1df2dfd7cc5ce4a167e

See more details on using hashes here.

File details

Details for the file parsemon2-3.0-py3-none-any.whl.

File metadata

  • Download URL: parsemon2-3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.5

File hashes

Hashes for parsemon2-3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9f7c3f9fbb02ca20297ca1348a359e4031877958ae7c3e7848aa160c14890a7
MD5 84106c9b3dfa57a176320933c2c6f261
BLAKE2b-256 a2ea45a7108c1a43d410d2d72484670d9d80304648366624fb1f09e2df438c7b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page