Skip to main content

Greenery allows manipulation of Regular Expressions as Finite State Machines

Project description


Implements tools for parsing and manipulating regular expressions and their sub-components
(, and for producing finite-state machines that implement them (greenery.fsm).


Import the parts of the greenery subsystem that you wish to use, eg:

from import (parse, lego)
regex = parse( "a*b" )
assert isinstance( regex, lego )

This style will work with either version 1.x or version 2.0+ of greenery installed; both versions
contain the greenery.fsm and packages.


Version 2.0 provides exactly the same functionality as 1.x, but restores the ability to import and
use and greenery.fsm separately as the default. In the 1.x versions, executing:

import greenery
regex = greenery.parse( "a*b" )

would import all of greenery.fsm.* and* into the greenery namespace.

To restore version 1.0 behavior for legacy code, use the greenery.v1 compatibility interface:

import greenery.v1 as greenery
regex = greenery.parse( "a*b" )

To make version 1.x style code work with either version 1.x or version 2.x, use:

import greenery.v1 as greenery
except ImportError:
import greenery
# ...greenery version 1 code...

Project details

Release history Release notifications

History Node


History Node


History Node


This version
History Node


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
greenery-2.0.tar.gz (32.1 kB) Copy SHA256 hash SHA256 Source None Mar 11, 2014

Supported by

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