Skip to main content

Convert word to keypress-sequence

Build Status

I made this as a submodule for my project on correcting password typos. I found this very cool, and might be useful in many scenarios where one has to find vairations of word due to mistyping.

Here we define typo as purely mistyping a key, and not due to ignorance. Hence, finding possible typos of a word require converting the word into sequence of key presses. This module provides those functionality to convert word into and from sequence of key presses. Also, given a word find the possible typo of that word tuned to the typos due to mistyping.

Dependency

Right now it needs cython. I will remove it in future. * Cython.

Install

$ pip install word2keypress

# or

$ python setup.py install

How to Use?

Refer to the HowToRun.ipynb file.

from word2keypress import distance, Keyboard
kb = Keyboard(u'US') # making unicode is mandatory (weird Cython)
kseq = kb.word_to_keyseq('Password')
print "\nRaw sequence:", repr(kseq)

print "\nReadable sequence:", repr(kb.print_keyseq(kseq))

print "\nkeyseq->word:", kb.keyseq_to_word(kseq)

print "\ndistance:", distance('Password1', 'PASSWORD1')

How to test/develop ?

(For myself, as I keep forgetting how to deal with cython. Stupid Idea) Don’t forget to regenerate the src/word2keypress/_keyboard.c file in Option 1.

$ python setup.py pytest      # Option 1
$ tox                         # Option 2
$ python -m pytest tests/     # Option 3

In any case have to regenerate the _keyboard.c to test with the new code.

Metadata

Release files for word2keypress 1.0.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for word2keypress 1.0.16
File Size Uploaded Provenance
word2keypress-1.0.16.tar.gz 192.5 kB Without provenance Details

Release files / word2keypress-1.0.16.tar.gz

Download URL word2keypress-1.0.16.tar.gz
Size 192.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d1cf380b4795e4c0071ce92d388224f910eee16135824151da8328f11be3ed04
BLAKE2b-256 checksum
How to use checksums
f131fe02ab3dc90b7d39869fb3ec89c60b855773ed3b05ec90929aa22a146f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.2

Security for word2keypress 1.0.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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