This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Introduction

Omega is a framework designed to help you build parsers for text and binary data. It creates a recursive-descent/Parsing-Expression-Grammar parser given a description of the file-format in the concise Omega language, but if your file-format can’t be described in pure Omega, it’s easy to extend with Python.

For example, here’s a very simple parser for arithmetic expressions:

>>> import omega
>>> class ArithmeticParser(omega.BaseParser):
...     __grammar = """
...             digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7'
...                     | '8' | '9' ;
...             term = digit+:ds -> (int("".join(ds)))
...                     | '(' sum:s ')' -> (s)
...                     ;
...             product = term:a '*' product:b -> (a * b)
...                     | term:a '/' product:b -> (a / b)
...                     | term
...                     ;
...             sum = product:a '+' sum:b -> (a + b)
...                     | product:a '-' sum:b -> (a - b)
...                     | product
...                     ;
...         """

And here it is in action:

>>> ArithmeticParser.match("1")
1
>>> ArithmeticParser.match("1+1")
2
>>> ArithmeticParser.match("6*9")
54
>>> ArithmeticParser.match("2+3*4")
14
>>> ArithmeticParser.match("(2+3)*4")
20

Omega is heavily based on ideas from Alessandro Warth’s [OMeta package][1] for Smalltalk and JavaScript, but translated to fit as naturally as possible into Python.

[1]: http://tinlizzie.org/~awarth/ometa/

Requirements

Omega is a pure-Python package, and requires only Python 3.4 or higher to be installed.

What’s In The Box

  • README.md is this file.
  • TODO.md is a list of possible future additions to the package.
  • LICENCE is the full text of the licence this software is released under, the GPLv3.
  • setup.py is the standard Python packaging script.
  • docs is a subdirectory containing all the documentation for Omega, including language and library references, a Python API reference, and a tutorial.
  • examples is a subdirectory containing various self-contained example parsers written in Omega.
  • omega is the Python package itself.

Installation

Omega uses the standard distutils packaging system for Python, so if you have a source tarball, you should be able to install it with:

python setup.py install

…and of course all the other standard distutils commands are available.

Documentation

The complete documentation is packaged with Omega source releases, and is also available online at https://gitlab.com/Screwtapello/python-omega/wikis/home

Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
python-omega-0.1.2.tar.gz (54.6 kB) Copy SHA256 Checksum SHA256 Source Dec 30, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting