Skip to main content

Finds the closest neighboring keys of a given letter on a specific keyboard layout

pip install surroundingkeys

Tested against Windows 10 / Python 3.10 / Anaconda

A utility function to find the closest neighboring keys of a given letter on a specific keyboard layout.

Parameters:
-----------
letter : str
	The letter for which to find the neighboring keys.
keyboard : str
	The keyboard layout identifier. Should be one of the identifiers shown when you call show_all_keyboards().

Returns:
--------
dict
	A dictionary containing the neighboring keys of the input letter on the specified keyboard layout.
	The dictionary has the following structure:
	{
		input_letter: {
			'side': [list of letters on the left and right sides],
			'top': [list of letters above the input letter],
			'bottom': [list of letters below the input letter]
		}
	}
	If no neighboring keys are found or the input letter is not available on the specified keyboard layout,
	the corresponding list will be empty.

Example:
--------
	from surroundingkeys import get_next_letters, show_all_keyboards
	for letter in 'Oi, tudo bem?':
		result = get_next_letters(letter=letter, keyboard="kbdbr_1")
		print(result)
		print(letter)
	{'O': {'side': ['I', 'P'], 'top': ['9', '0'], 'bottom': ['K', 'L']}}
	O
	{'i': {'side': ['u', 'o'], 'top': ['8', '9'], 'bottom': ['j', 'k']}}
	i
	{',': {'side': ['m', '.'], 'top': ['k', 'l'], 'bottom': []}}
	,
	{' ': {'side': [], 'top': [], 'bottom': []}}

	{'t': {'side': ['r', 'y'], 'top': ['5', '6'], 'bottom': ['f', 'g']}}
	t
	{'u': {'side': ['y', 'i'], 'top': ['7', '8'], 'bottom': ['h', 'j']}}
	u
	{'d': {'side': ['s', 'f'], 'top': ['e', 'r'], 'bottom': ['x', 'c']}}
	d
	{'o': {'side': ['i', 'p'], 'top': ['9', '0'], 'bottom': ['k', 'l']}}
	o
	{' ': {'side': [], 'top': [], 'bottom': []}}

	{'b': {'side': ['v', 'n'], 'top': ['g', 'h'], 'bottom': []}}
	b
	{'e': {'side': ['w', 'r'], 'top': ['3', '4'], 'bottom': ['s', 'd']}}
	e
	{'m': {'side': ['n', ','], 'top': ['j', 'k'], 'bottom': []}}
	m
	{'?': {'side': [], 'top': [], 'bottom': []}}
	?


Note:
-----
This function uses a cache (LRU cache) to speed up repeated calls with the same inputs.

Metadata

Release files for surroundingkeys 0.10

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

Source distribution (sdist)

Source distribution for surroundingkeys 0.10
File Size Uploaded Provenance Actions
surroundingkeys-0.10.tar.gz 73.3 kB Without provenance Details for surroundingkeys-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for surroundingkeys 0.10
File Interpreter ABI Platform Actions
surroundingkeys-0.10-py3-none-any.whl Python 3 none any Details for surroundingkeys-0.10-py3-none-any.whl

Total release size: 454.7 kB

Release files / surroundingkeys-0.10.tar.gz

Download URL surroundingkeys-0.10.tar.gz
Size 73.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6de72bfd273fd077acb7da212e8628f17b096ae482d6dcdc253c779c3c986fab
BLAKE2b-256 checksum
How to use checksums
8db86242f1e70160f5da601b2dc8ca178077cf8b530bebe20fb695dada6a5234
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / surroundingkeys-0.10-py3-none-any.whl

Download URL surroundingkeys-0.10-py3-none-any.whl
Size 381.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0f74669074ce28ce4164681b18947aba94d16a2229cc26466efbf0f85470389
BLAKE2b-256 checksum
How to use checksums
7331a45b838522d2215cd8c481b32535f9be22dfbb5d32f050de183c0dc2a71a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Security for surroundingkeys 0.10

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.

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files No provenance

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