Skip to main content

bootpeg – the bootstrapping PEG parser

Project description

Documentation Status Available on PyPI Unit Tests (master) Verification (master) Test Coverage

> Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.

bootpeg is a PEG parser for creating parsers – including itself. By default, it supports a modified EBNF with actions akin to PEP 617.

# memoizing bottom-up PEG parser
$ python3 -m bootpeg.pika.boot

Unlike most other Python PEG parsers which are top-down Packrat parsers, bootpeg provides a bottom-up Pika parser: it handles left-recursive grammars natively, allows recovering partial parse results, and runs in linear time for usual inputs. This makes it straightforward to define custom grammars without worrying about their implementation.

Do I need a bigger boot?

> Some people, when confronted with a problem, think “I know, I’ll use self-writing parsers.” Now they have problems+.

If you need a battle-hardened, production ready parser suite then pyparsing should be your first choice. If you are the choosy type, make it your second choice as well.

Pick bootpeg when you need safe left-recursion and self-parsing. It will never bite off your left peg via infinite recursion. It will take care of itself and all its grammars to make you happy. bootpeg is the friend you need when you know bootpeg is the friend you need.

Well, eventually it will be; bootpeg is still a cute little puppy. Don’t let it lift too heavy. So far it is only lifting itself.

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

bootpeg-0.5.0.tar.gz (20.6 kB view hashes)

Uploaded Source

Built Distribution

bootpeg-0.5.0-py2.py3-none-any.whl (18.2 kB view hashes)

Uploaded Python 2 Python 3

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