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.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.dev4.tar.gz (14.9 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 10.9+ x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m macOS 10.9+ x86-64

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4.tar.gz
  • Upload date:
  • Size: 14.9 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4.tar.gz
Algorithm Hash digest
SHA256 6a3873f129db4d519df1e92620a4ddbf68f8ac599b0833866f0e4bb8bf2a7bda
MD5 54f12633a6646802d86b85285ac92ba8
BLAKE2b-256 53064fa7cffd90a22bcb5b42948f7a542b488a7c61d7d988feabf344e44d47b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 16.4 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fb5a444763887f351f9512e7c6239dbaca8191b2fe1b01b2cfc94f69d9eb019e
MD5 688e9f5b8ba43d2700fa13e127e4d546
BLAKE2b-256 89d7ec6ecb5e3663eaffcab6472f33b24c18d088d18d49c3c62166d859eb28ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7317720940b4351a7e15405ef82ba46519829820a52d9894e44a57fef3c433fc
MD5 fdba36c1ba8b159280ec92c4544a8b88
BLAKE2b-256 d88b3cf00e1c63d202685cff75a3784a398ee7dcfed4d98946dd562bebaf0d0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 13.6 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 285d9a33c9c98a2a33e2566ff72fc45a0129d0f3281af5023827b4fe73173e56
MD5 0588f2cdc3ac88826eeb6456ff84a408
BLAKE2b-256 01069a00985af6ffe00fa66fa67f546a24af00de6243d5e5f509f8633d6d153d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 16.6 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 31c9f75bb5f1d4f523a09b9505d9ad06069195d7f2ea8efd6590ec0e716e211a
MD5 17edda56b555fd1101163e7ce62a7c77
BLAKE2b-256 786279f5b08cc53e4bd6040f9b07fd0760bbfb7744459243360cf6a1360e250c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 99d67e36609e4d3f1742ab84d39961b50180773dd5883c739c21194786cb86c0
MD5 b50fa7a98f96dfc1f295717758d49fef
BLAKE2b-256 ba269de2c835a16fb63a653ccd69348fe2d635b1c3cf249bbecebe8310559c5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.9 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 94ac91779bdda20ef288860d171fd3aeed0c4c19724f4b350e41141c1d3c7c99
MD5 300b212b93b71f47388c742a6240c889
BLAKE2b-256 0c165a9f619681cc6c26b1aa9fb860b17b7bfced7d68b895a1752db61608cf78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-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.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6c70787889985793254512a4f5f6fdcfaa5f54139d154067087f2244c78a18a8
MD5 e0c55cacca10e4131d491861d5738cc6
BLAKE2b-256 d149638a707ae6a0fd980eec92a9093797c7a7a53919e3e4c305d9a3c3b3fa6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eed5b307d3d050b16e67fe1ec5d48a66f82be58bce5c609d26f7545e6e3b9b47
MD5 1855a5356e0aa092eecc59fa5a153184
BLAKE2b-256 c3be300e57161e9120cc436ed1ff1b218f6b59c0650ade2adcae2a68e2dc8db0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 15.1 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f6bdd6264e03b41a83ae67ea54ceba57177e6beecd1850663e157ba1d325c513
MD5 18e3295c82c49d66bfa8fcb76f6986c6
BLAKE2b-256 48f5b39baa45fc97cf4010a28b64c1577f630f106dd70f3774e7844268d572d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-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.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 673441cde380b4a4e916f7b233a02ae474358093b1a796a9bcb5a90968362d7c
MD5 2eddf58a88d62a700593ca8979f55be3
BLAKE2b-256 abad6dc4ee424a051a5f318c720dab2c27090cfbd6fccb5601f445ade0fbbc8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37c9fe8f03acce0ea2a8fa78b37188fc8e43af1d9aed8823ea5c622e8a92f681
MD5 42985a2807ff96a42d55552140c8e92a
BLAKE2b-256 73f1367ebfdbcda8a68df371deddac7829937a9c6cfa7d7f2ead2192b9b78874

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev4-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 15.0 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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8d2454c6675d198284c6b7c9734253114fe1edba7584449b492e1880636f0f12
MD5 f517f0f82a0eec21f68e2b700770b175
BLAKE2b-256 14d5d679232b042e50c1b2577b0e7bc66aa7a76ff2952f23b02ea61849ccc259

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