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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 10.9+ x86-64

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

Uploaded CPython 3.8 Windows x86-64

plover_stroke-1.0.0.dev2-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.dev2-cp37-cp37m-win_amd64.whl (16.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

plover_stroke-1.0.0.dev2-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.dev2-cp36-cp36m-win_amd64.whl (16.7 kB view details)

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2.tar.gz
  • Upload date:
  • Size: 14.6 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.dev2.tar.gz
Algorithm Hash digest
SHA256 fd7f95c9ff07e9d1abf04cbf2e3ed6a182a9e0d7ce19e1a75fb60ed62104ea9c
MD5 95fbb77eeb2ec6a0c207c3746c27a982
BLAKE2b-256 14dd249a730731efff211173be13c6729d07df959a091d73f08c9314dfd2ced4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 871a36a0b3d7738c34fd2dccc30a993540f23799bd7674a1e17fc3d2a757fe4d
MD5 410ed33c80b8d26d136c40bd52788872
BLAKE2b-256 5b5d873f612c27f80563bb1b9b19fff1177455265e9db3b47f29d0ecb8e2d396

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55f6be6033063d2ffb990ceb65df090de02c975efb84acebffe71dac6ccdb9c8
MD5 ae9513625ca1bbb59f85a9f521c21cf1
BLAKE2b-256 9934c3e0f20fe1feb91ca41a96088d1e5ba451e02f94165426897843a3355962

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.2 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.dev2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 81c937b3150aeeddc2e1a9a2142ba7f3c9521215f2073eaea11f0ffef42f363d
MD5 5ad02d1d61f1c3ef2298e692ef64aa3a
BLAKE2b-256 9802eda88f72c152b6e0946a0cd3b151b36b3096cf1de37d5698d3eca3437692

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 16.9 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.dev2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b352314ba370b37c3421b0e5b443b5dfce9b6b4e7d86495303ef08391e804f32
MD5 988970bfb905f31fc55e6d0472d2478b
BLAKE2b-256 8f2384c86a702d43f4f8eb0803b33602c5fa1dc1f06775945bd2df1d1609bd2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 33342b57297cf4aa77aeb57ddad154bc6b7ce00df6ceed0229f79551b8c7a290
MD5 0516f13be205b88fb328db33cd582a99
BLAKE2b-256 689827f9fcaedcb852b9a27dec2fffd2bceeaf6f4cba9293cf0fa341f540ae44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5c8d31bc35f856bd72d48cee26817840901fa3cd842e30727a3489e8d0fb86f1
MD5 cd0aade7effac29fa3b9a12c83356d1c
BLAKE2b-256 82f53c7c2483fb29f020bdafcbd4f7ce8faab8eab704bcfa6485604231eddfb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 16.8 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.dev2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 31184b994175acb78c5d3c5e7d0db15c5a023c5aea579e8e53357895b0444d4d
MD5 9a366fe3c2ca374f0524bb1efcf3f691
BLAKE2b-256 52f314325dcd18895a6f823b1d83cf11a135c9c8677531da3b18dd670482727c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf488ac3bfedc8c85c1ef075b8141c44cce25a20500a5fe3ca4e0e4e9bc47305
MD5 04ed8883bafe2be6ee4edc83dddbcc24
BLAKE2b-256 8a7291b9dc27a6c91f7c0c31ec14df8d47cbedebc10a77b303f9bed317db552a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-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.1 CPython/3.9.5

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2d85ce0f8fc4e4fd2039eba7aa87d1de411deded934afd2de0d4484939c23f46
MD5 713fd9d66e7df91d634db6ee92932b92
BLAKE2b-256 e2e4a51f8c9590057180622deabe02001921e113f99732e5499b6d870768e820

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 16.7 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.dev2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 f2f677965b36f92d02525cd0935eff95a4ef64835d199468c3d79fba85fab22a
MD5 a6fc8ddbea102a282d5d2bad4ca4101b
BLAKE2b-256 8ec276bd828ee9d9088f56fc191512475bb409edf22a6e5fa7b512de04a08ea2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plover_stroke-1.0.0.dev2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 454490402bbb762fd5b74f7f11c14841c65cdd27b7373e2b59ba2188dbe9fb26
MD5 85b9a502874fb6445416dabcd50433a3
BLAKE2b-256 049b5b614be3026e057f442dfbd62aeff805dfbeb9d454a78b71b8e9104f270c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: plover_stroke-1.0.0.dev2-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 14.2 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.dev2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 58b43570d0de94b4eaefecebb1cae0c72758338f670875b341fa78f8b815e2c0
MD5 f8844d5e6397b94649dc8a382ba2551b
BLAKE2b-256 e210e3ab19116f00b259a1841ef3a7f81cc448930559f52cc99b289205949a3a

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