Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

ssfsm is a constructive library implementing deterministic finite state machines. The fun thing is, that it has a stupidly simple API.

Project description

ssfsm is a constructive library implementing deterministic finite state machines. The fun thing is, that it has a stupidly simple API. Example:

# A FSM that accepts b*a(ab)*
import ssfsm
A = ssfsm.Machine()
A.One['a'] = A.Two
A.One['b'] = A.One
A.Two['ab'] = A.Two # a and b transition
A.Two = True # Set state Two to accepting
A().reset(A.One)

And transitions are done this way:

A('a') # a-Transition
A('ab') # a-Transition followed by b-Transition
bool(A) # is A in an accepting state

Some helpers to make construction even easier so the first example can be written as:

import ssfsm
A = ssfsm.Machine('One')
A().alphabet = 'ab'
A.One['b'] = A.One
A().polyfill(A.Two)
A.Two = True

Project details


Release history Release notifications

This version
History Node

0.6.0

History Node

0.5.0

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
ssfsm-0.6.0.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None May 5, 2015

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