Skip to main content

Stroke handling helper library for Plover

Project description

Plover Stroke

Helper class for working with steno strokes.

Usage:

# Setup:

from plover_stroke import BaseStroke

class Stroke(BaseStroke):
     pass

Stroke.setup(
    # System keys.
    '''
    #
    S- T- K- P- W- H- R-
    A- O-
    *
    -E -U
    -F -R -P -B -L -G -T -S -D -Z
    '''.split(),
    # Implicit hyphen keys (optional, automatically
    # deduced from system keys if not passed).
    'A- O- * -E -U'.split(),
    # Number bar key and numbers keys (optional).
    '#', {
    'S-': '1-',
    'T-': '2-',
    'P-': '3-',
    'H-': '4-',
    'A-': '5-',
    'O-': '0-',
    '-F': '-6',
    '-P': '-7',
    '-L': '-8',
    '-T': '-9',
    })

# Creating strokes:

Stroke(56)
# => KPW
Stroke(('-F', 'S-', '-S', 'A-', '*')) 
# => SA*FS
Stroke('R-')
# => R
Stroke('L-')
# => invalid, raise a ValueError

# Methods:

s = Stroke('STK')

s.keys()
# => ('S-', 'T-', 'K-')
s.is_number()
# => False
int(s)
# => 14
s == 0b00000000000000000001110
# => True

# Strokes can be compared:
sorted(map(Stroke, 'AOE ST-PB *Z # R-R'.split()))
# => [#, ST-PB, R-R, AOE, *Z]

Release history

1.0.0

  • drop Stroke.xrange and Stroke.xsuffixes methods
  • Stroke.keys() now return a tuple
  • fix corner case when parsing steno (RR -> R-R)
  • fix RTFCRE when numbers are involved (align with Plover's behavior)
  • fix implicit hyphen handling when numbers are involved
  • renamed Stroke.isnumber to Stroke.is_number
  • speed up implementation through a C extension

0.4.0

  • fix stroke comparison

0.3.3

  • fix python_requires package metadata

0.3.2

  • first public release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plover_stroke-1.0.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distributions

plover_stroke-1.0.0-cp310-cp310-win_amd64.whl (16.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

plover_stroke-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

plover_stroke-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl (13.5 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

plover_stroke-1.0.0-cp39-cp39-win_amd64.whl (16.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

plover_stroke-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

plover_stroke-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl (13.5 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

plover_stroke-1.0.0-cp38-cp38-win_amd64.whl (16.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

plover_stroke-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

plover_stroke-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl (14.8 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

plover_stroke-1.0.0-cp37-cp37m-win_amd64.whl (16.4 kB view details)

Uploaded CPython 3.7m Windows x86-64

plover_stroke-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.9 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

plover_stroke-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (15.0 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

plover_stroke-1.0.0-cp36-cp36m-win_amd64.whl (16.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

plover_stroke-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

plover_stroke-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl (14.9 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

Details for the file plover_stroke-1.0.0.tar.gz.

File metadata

  • Download URL: plover_stroke-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e1f4c03113b9726410c22a1e5696adecb162f68c9f5d8520ee771dc3eadf472d
MD5 1a036c950b126a6a74c53c59047042b4
BLAKE2b-256 2d1468842762de2967eba2a1c2f7ea49c34776377c0547ddecd08bfbae83adee

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e958a2c62d99b6579f8e859d530e47142d9e9754e6b3e620a58479a6f09afeb9
MD5 2c277ab4bac6d565af1989980233ca19
BLAKE2b-256 ab66955adaa4f3e8270e10280367221473d6b32d1ad3e1c6ad61f139aa445a6b

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plover_stroke-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad211c446602fcb48c445bed3328fa4b13568e379feb73f428326edfb97cbc7a
MD5 949da4872cf9ed54be499995182506cc
BLAKE2b-256 6b4c16c8daf08c58adb34d23f5201f1e514925996d71a26db1b7c852a3935be1

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: CPython 3.10, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d42ca6109dcc3a062cc61d902d8f1f74568bd4509b7ef3824d4da0a40226c735
MD5 794b011fe2a53924ac8c4230810130ef
BLAKE2b-256 b2f0b6678caec8965a3bcbab87f8a18b9bb69139c924613cb4e1ddf8cde3ccdb

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 89ff18a92d5b745979493b765bbbf4d6aca230fff8ea7c5e13e54ecbdf3ffd3c
MD5 52f279db74ac5d6a25415a9288fefda5
BLAKE2b-256 dc6d1031dde806e22f1f57889de6c3d09c0a91e1c082aa47601cc158cc29a1fd

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plover_stroke-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bdd5fbe056f9b31d9aedf7169118a8d1103472a2ff97655b1e2efe4b56ac8cb9
MD5 0ea3c4152c7dab331aa60e6315a58c7b
BLAKE2b-256 134cb3482fee949b3bdc1e210c4ecc78e6e311fed61376ac24b7bebccc2ef951

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0c571e2316d6f2f47eabb99f174416a31a45dfb6ab39046acf11191ceed832fb
MD5 0ee055705c5b6e4051216db68313daa7
BLAKE2b-256 cd33979578a0999d2504468a6cbf7e5eda41189c1874b3c8c57c3874ea85e08e

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 277905169511a527ed026fd0f2a983cd96f3cc8b42edf85d399529a202ae4a51
MD5 c35fa56bbdf609a53165174db048e98d
BLAKE2b-256 b66fe9fc35d03f14b1f568319944139e2063d0e4d08b5701b0773788d871fa48

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plover_stroke-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 344fc2c1127731665086a94224117229e4710ea9870a5e856762ce8ed3c75fa6
MD5 e01e405a8b9d6c955de083d5f9e27737
BLAKE2b-256 ba7f1c0c6d3bcb490405ecf4c76d8f770118510f5c521cc7f116d44f20ca64cd

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e8430387fdc1a91443108d2952cd9f733df59c105c5b2f4a1a77b7332de6586c
MD5 f1839b47d19afd3914737d742451c361
BLAKE2b-256 ca0b67fc2836a8e6609a70643d061ad8a6eb1281f0cc0f303afa65e6a1f536f8

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b24bbdc48346e4e96e798587057218a5746a65546b8e2309c7720fea727b5ed7
MD5 e924447fc69b24f61a714a545d8b2393
BLAKE2b-256 c6b5de5527e126054b2512e9878781eb94a27bc195d927a5fbe1f54f254da523

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plover_stroke-1.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1086be4c6a6d7ab06972d43d6d3cd5a7aca87d40900ba4105ff049ba88e5cb12
MD5 3d7c770e89e973598f0c86661be4feaa
BLAKE2b-256 4d32dda8cfc27cdf399dd2b768609e7530178f2104cb04e727087eaafb56b4cd

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 10b2f89fe82987295ac6aff390dbdb41773c66f76dd60301cd5b66d40db96d82
MD5 43ea3ecdb8e3c2103ec83297e5b26d6e
BLAKE2b-256 b8fb25b8b21b6667ed3c91377c179779aee63f53ec93db2d94856909cf4c7a0c

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 af2bf0e9cc22198eddc808c52fff065152aa5f4313bad23f1c5d0dfbee558448
MD5 7d6ba30518ccf8d479faf2df9b4811a7
BLAKE2b-256 244b288dc456b55f52e6b36195849c12fb1b172e4096787e9c587d0566a56e3d

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for plover_stroke-1.0.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8031d2d1ca3d4204b04987a07c991d2b1963f8d8830afb180996f4ce5b260998
MD5 c8a55d92863856f9c0b3f85252e5c6a4
BLAKE2b-256 f77c8da86e32d718a877914fde3302d5d1794e212e45f9cb6ecb6e403d29d416

See more details on using hashes here.

File details

Details for the file plover_stroke-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: plover_stroke-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for plover_stroke-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 497e7ec6fb1db875c922858566820222ac16a36e355a67723c9df253207958d1
MD5 e65da45a8dfe15801209af763aeb682e
BLAKE2b-256 87fd3ef52282fb0935732ed5efe84574e956be4eb6e059cf557de0c6a8dcff02

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page