Skip to main content

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)

Source distribution for upysm 0.4.1
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

Release history Release notifications | RSS feed

This release

0.4.1 This release

1 release file

0.4.0

1 release file

0.3.11

1 release file

0.3.10

1 release file

0.3.9

1 release file

0.3.8

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

2 release files

0.3.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page