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 [unreleased]

  • drop Stroke.xrange and Stroke.xsuffixes methods
  • Stroke('') now raise an exception (use Stroke(0) to create an empty stroke)
  • 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.dev1.tar.gz (14.4 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 10.9+ x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m macOS 10.9+ x86-64

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1.tar.gz
Algorithm Hash digest
SHA256 3bb3409679486bc570c2fb9971cc8bef603d62679f7e7e5ae648a526d4d8e329
MD5 3ebd0f6818957c9df1982cdb7bf4751d
BLAKE2b-256 99b44c61a2df88b9865cbcf7eb1678abd6d90ec955e74acbac6945eaa526c00a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 66321a306fc3be372a7e7be36bdb413699a29d7df814516727dead8cdf737467
MD5 93d144119b605cffe888fbfd4aec7e03
BLAKE2b-256 b67a42d9b42affe49f5691aabc5a902dde9251bb5dd38b73897d842cea31c179

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 845e72fe8e1294cd92bae9b4a822a685334dce8ba62119b8f35206935b4aa004
MD5 039a6c210da67f6b6c0e7d5fea4e782e
BLAKE2b-256 e687e43e2c7e5c8d6979e53a4583a45add7cd750fe9f664b9f9b1a076085b2e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7f884b4654ff6b38a84acf471e1bcfa67c18904f88e7d4199962217d845d5b04
MD5 6a76cc16f62f835e4be3348685096793
BLAKE2b-256 62b26b2655bd3b3f1e3c2628f4e57989a67810abd722e164bfbb4b8a486f3ff8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b3e54b1d746a3a948fc522966fb0a0468755c9f5ad74295384a504c284d751aa
MD5 8729b52b09c64d5aabaa379f9a49868b
BLAKE2b-256 bd4af725ef69f240644204ae74142a761da9c0da7a7dc94550656f4d7a30289e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8ad5be35412d067b5b6cbc4863758d4a577ccac493e33ada7df467aa7a57233
MD5 d215d041eabd436f50379f6f76086063
BLAKE2b-256 64e0889506c5bbed136e2b2890aafd2b493ad59e76e1c838b639441242d7d8b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8269a30435a4643d89a0c668ea722d66046afd63433dd6cb3a4a207f0e609d42
MD5 1fb036e03a89a7dc17849388557e2027
BLAKE2b-256 68c9250fe6efd099fec5369fc420b6a0e601f167d05a598cb7a6db08e725f466

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8c81727a6ea6a513f8c1370fd3cea4d04750c7a4a3c57d365b8fbb2abfbde7a4
MD5 7cc0bcc9f93b4cc799658e7fb7ba38de
BLAKE2b-256 30e1dea1f1dd0bec923c3dd3ac21cec3733d3a4603929b81bf476deaeb12f5b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c74f3aaed11701434d03184e857cb0680b0b1ae498f71497c63f50d244d53165
MD5 05cd2cbabd55b24ce3b69227d254633d
BLAKE2b-256 16ddef5500077e6155dcd5bdd7c03494ab715cf10ab15225c35c52f5d9ff7393

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2d3d24496a87bcbaa4c97bee4135f061c866bbe2294bfd3c5655c3f8706e8c7d
MD5 f2a3a952d691ca3a46c5e1b45d388149
BLAKE2b-256 f34e4ea2f96873389376a25c4232ceeef4b83402dc197025c424f1f3866ff081

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f1e6cb6e555b3f38c807341d2029cc6404587bd5ec0ea5d3e96dff418e3be474
MD5 5bbd6e714ffc4638625343c9f3519832
BLAKE2b-256 935daf1997a87e988b890dd8a68b492721ed801afed7febcef7d976bf9f7fb3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 56a3401919190e9ec5b055d993b19d1f9d36f1bdcb0bf07719de1d0ccb91b465
MD5 bed769a290025222111e4855e9042bf7
BLAKE2b-256 548099041be29bafb7c1aa7d5ed3139fb72e78df065cd62e77edc3d9392eaab1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 93476a86ac867f2dc3144613203a55e4f0884209aee5ed921f7255c99492cf66
MD5 f0a01a53f16388c656c3d62b76e8bec9
BLAKE2b-256 fe0eb6e41a3b65296e24cfe6a75a05f45a993abcc75fd439822b0b41bc64378a

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