Package: automate
AutomateGithub URL:http://github.com/tuomas2/automateRead full documentation athttp://python-automate.readthedocs.org/Automate is a general purpose automatization library for Python.
Its objective is to offer convenient and robust object-oriented programming
framework for complex state machine systems. Automate can be used to design
complex automation systems, yet it is easy to learn and fun to use. It was
originally developed with home robotics/automatization projects in mind,
but is quite general in nature and one could find applications from various
fields that could take advantage of Automate. Automate can be embedded
in other Python software as a component, which runs its operations in
its own threads.Highlights:Supported hardware:Raspberry Pi GPIO input/output portsArduino supportfor analog and digital input/output ports and VirtualWire wireless networking
withAutomateFirmata.Easy to write extensions to support other hardwareSystem state saving and restoring via serializationIntelligent design:Comprehensively tested viapy.testunit/integration testsTakes advantage ofTraitslibrary, especially its
notification system.IPythonconsole to monitor, modify and control system on-the-flyVersatile function/callable library to write state program logicRPC and Websocket interfaces to connect between other applications or other Automate systems.Comprehensive and customizableWeb User InterfaceUML graphs can be drawn automaticlaly of the system (as can be seen in the examples
of this documentation)ExampleLet’s take a look at a small Automate program as an example:fromautomateimport*classMySystem(System):# HW swtich connected Raspberry Pi GPIO port 1hardware_switch=RpioSensor(port=1)# Switch that is controllable, for example, from WEB interfaceweb_switch=UserBoolSensor()# Lamp relay that switches lamp on/off, connected to GPIO port 2lamp=RpioActuator(port=2)# Program that controls the system behaviourprogram=Program(active_condition=Or('web_switch','hardware_switch'),on_activate=SetStatus('lamp',True))my_system=MySystem()This simple example has two sensorshardware_switch,web_switch, actuator (lamp) and aprogramthat
contains logic what to do and when. Here,lampis switched on if eitherweb_switchorhardware_switchhas
statusTrue.Installing AutomateAutomate can be installed like ordinary python package. I recommend installation
in within virtual environment (seevirtualenv).(optional): Create and start using virtualenv:mkvirtualenv automate
workon automateInstall from pypi:pip install automateOptionally, you can specify some of the extras, i.e. web, rpc, raspberrypi, arduino:pip install automate[web,rpc,raspberrypi,arduino]or if you want them all:pip install automate[all]LicenseAutomate is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.Automate is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with Automate.  If not, seehttp://www.gnu.org/licenses/.