upysm
upysm is the MicroPython distribution channel for
pysm, a finite state machine library.
Use pysm directly on regular Python. Use upysm when installing the same
library on MicroPython.
The library source still belongs to pysm. upysm is not a fork and does not
carry separate application code; it publishes MicroPython install artifacts
from selected pysm releases.
Install on MicroPython
Modern mip/mpremote install:
mpremote mip install https://pgularski.github.io/upysm/
Pin a specific version when you want repeatable device builds:
mpremote mip install https://pgularski.github.io/upysm/0.4.0/
From the MicroPython REPL:
import mip
mip.install('https://pgularski.github.io/upysm/')
Legacy upip install:
import upip
upip.install('upysm')
The installed package imports as pysm, because the API is the upstream
library API:
from pysm import Event, State, StateMachine
Example
from pysm import Event, State, StateMachine
on = State('on')
off = State('off')
sm = StateMachine('sm')
sm.add_state(on, initial=True)
sm.add_state(off)
sm.add_transition(on, off, events=['off'])
sm.add_transition(off, on, events=['on'])
sm.initialize()
assert sm.state == on
sm.dispatch(Event('off'))
assert sm.state == off
sm.dispatch(Event('on'))
assert sm.state == on
For the full API, see the
pysm documentation.
Maintainer release notes live in RELEASING.md.
Metadata
Release files for upysm 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| upysm-0.4.1.tar.gz | 12.8 kB | Details |
Release files / upysm-0.4.1.tar.gz
| Download URL | upysm-0.4.1.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1dbba3c7509c9f1c26184f8eff118976fa9e0e77bd97ec86eff2806636e4d5d
|
|
BLAKE2b-256 checksum How to use checksums |
7c211b6c1b240844ffd904362cd13cee75e309465a25492a44d5686bf816c812
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|