Skip to main content

Parser engine for ordered text.

Project description

Ordered data consists of a sequence of tokens that appear in a predictable order. Unlike fixed-field data, ordered data may contain tokens that are optional or that may repeat a variable number of times. These two properties prevent a parser from relying on a token’s positional index. The only guarantees provided by an ordered data grammar are the order that the tokens will appear in, whether or not they are optional, and how many times a specific token may repeat before a different token appears.

An example of ordered text is a U.S. street address:

123 Broadway Ave., Apt. 15, Philadelphia, PA 19101

The elements of the address (street number, street name, city, etc.) appear in a consistent order if the address is to be considered valid. The apartment number may or may not be present in an address, but should appear in a consistent position in the sequence in order to be valid.

A parser’s grammar is defined by a sequence of GrammarElement instances. Each of these elements is applied in the order it appears in the sequence. Since the parser also extends AbstractCommand, hierarchical ordered text can be parsed by using one or more ordered parser instances as elements of another parser’s grammar.

Project details

Release history Release notifications

This version
History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
ordtext-0.1.1.tar.gz (11.2 kB) Copy SHA256 hash SHA256 Source None Sep 19, 2015

Supported by

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