pylibtermkey
pylibtermkey is a set of Python bindings for libtermkey, a library for interpreting terminal input. Other Python bindings are out of date and not easily installable. This project has a few differences:
- libtermkey is automatically built as part of this project
- pybind11 is used for easy binding
- unit tests are included
- precompiled wheels are built from this repo and available on PyPI
Installation
To install from PyPI:
pip install pylibtermkey
Example
A minimal example of obtaining a keystroke and printing the results:
import pylibtermkey_cpp as termkey
tk = termkey.TermKey()
res, key = tk.waitkey()
print(res)
print(tk.strfkey(key, termkey.TermKeyFormat.VIM)
Note that, by default, termkey will read from stdin causing python terminal to not display typed characters. It is best to use termkey in an pre-written script rather in a REPL setup (as you will not be able to see what you are typing once termkey is active).
For other features, see the tests or the libtermkey man pages.
Building
To build this project:
Building from source requires cmake (pip install cmake).
python setup.py
Unit tests
To run the unit tests:
python setup.py test
or use nose:
nosetests python/pylibtermkey
Licensing
This project is licensed under the MIT license. It uses the pybind11 and libtermkey projects whose licenses can be found in those projects' directories.
Metadata
Release files for pylibtermkey 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylibtermkey-0.3.1.tar.gz | 647.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pylibtermkey-0.3.1-cp38-cp38-manylinux2014_x86_64.whl | CPython 3.8 | CPython 3.8 | Linux glibc 2.17+ x86-64 | Details |
| pylibtermkey-0.3.1-cp38-cp38-macosx_10_13_x86_64.whl | CPython 3.8 | CPython 3.8 | macOS 10.13+ x86-64 | Details |
| pylibtermkey-0.3.1-cp37-cp37m-manylinux2014_x86_64.whl | CPython 3.7 | CPython 3.7 pymalloc | Linux glibc 2.17+ x86-64 | Details |
| pylibtermkey-0.3.1-cp37-cp37m-macosx_10_13_intel.whl | CPython 3.7 | CPython 3.7 pymalloc | macOS 10.13+ Intel (x86-64, i386) | Details |
| pylibtermkey-0.3.1-cp36-cp36m-manylinux2014_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | Linux glibc 2.17+ x86-64 | Details |
| pylibtermkey-0.3.1-cp36-cp36m-macosx_10_13_intel.whl | CPython 3.6 | CPython 3.6 pymalloc | macOS 10.13+ Intel (x86-64, i386) | Details |
| pylibtermkey-0.3.1-cp35-cp35m-manylinux2014_x86_64.whl | CPython 3.5 | CPython 3.5 pymalloc | Linux glibc 2.17+ x86-64 | Details |
| pylibtermkey-0.3.1-cp35-cp35m-macosx_10_13_intel.whl | CPython 3.5 | CPython 3.5 pymalloc | macOS 10.13+ Intel (x86-64, i386) | Details |
Total release size: 2.3 MB
Release files / pylibtermkey-0.3.1.tar.gz
| Download URL | pylibtermkey-0.3.1.tar.gz |
|---|---|
| Size | 647.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd8d54300daf55555ba2567921d288496ccca8521392465943745214d0ac72ff
|
|
BLAKE2b-256 checksum How to use checksums |
83d5731244efe29f5fa17b921cb2efcb41a8257db2a7977a4183ccb30465cb74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Release files / pylibtermkey-0.3.1-cp38-cp38-manylinux2014_x86_64.whl
| Download URL | pylibtermkey-0.3.1-cp38-cp38-manylinux2014_x86_64.whl |
|---|---|
| Size | 299.1 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2d9a0640a7501bd04e2731dd83fe5df6d1205f37482e44dd15cb641bb1683892
|
|
BLAKE2b-256 checksum How to use checksums |
2405a4b54f4256e638a51977d8eb2aa1b17fda9b131e31d6ef19df3f4c27ceb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Release files / pylibtermkey-0.3.1-cp38-cp38-macosx_10_13_x86_64.whl
| Download URL | pylibtermkey-0.3.1-cp38-cp38-macosx_10_13_x86_64.whl |
|---|---|
| Size | 124.3 kB |
| Tags | CPython 3.8 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d9517c1ab923dcba8ef6f7f28347ce54e3b198cded90de6430ffb368353398b
|
|
BLAKE2b-256 checksum How to use checksums |
f348818fcd9a4b2498d9136ef837651fd56dee04848b271d713f73832680f79c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.17
|
Release files / pylibtermkey-0.3.1-cp37-cp37m-manylinux2014_x86_64.whl
| Download URL | pylibtermkey-0.3.1-cp37-cp37m-manylinux2014_x86_64.whl |
|---|---|
| Size | 300.5 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
2b6ffbf8ab3067f5170480808f5e04f7d46ef781c5dd61faf70353b6413ff3df
|
|
BLAKE2b-256 checksum How to use checksums |
1480f44fcdd96227acba11a90038f71a0543e02d045c1f39bb6d2ff1b1134fba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Release files / pylibtermkey-0.3.1-cp37-cp37m-macosx_10_13_intel.whl
| Download URL | pylibtermkey-0.3.1-cp37-cp37m-macosx_10_13_intel.whl |
|---|---|
| Size | 120.8 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.13+ Intel (x86-64, i386) |
|
SHA-256 checksum How to use checksums |
a4abbeddea0ebd36ad2b648077ae352604e271a3855a18565ea61d5b36437885
|
|
BLAKE2b-256 checksum How to use checksums |
d29ee535408b20d45720d88d79c2497cfbbb88683dc220665cc4c7dbf5463b31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.17
|
Release files / pylibtermkey-0.3.1-cp36-cp36m-manylinux2014_x86_64.whl
| Download URL | pylibtermkey-0.3.1-cp36-cp36m-manylinux2014_x86_64.whl |
|---|---|
| Size | 300.4 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1261eb4a3971c29e3e7bb923a6c9d9b86c91af53450440dd1b38419da8fdf210
|
|
BLAKE2b-256 checksum How to use checksums |
0781a9b278e7c01110cba32db4e05dada7151a9562ad4e1d7416021fa0482159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Release files / pylibtermkey-0.3.1-cp36-cp36m-macosx_10_13_intel.whl
| Download URL | pylibtermkey-0.3.1-cp36-cp36m-macosx_10_13_intel.whl |
|---|---|
| Size | 120.7 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.13+ Intel (x86-64, i386) |
|
SHA-256 checksum How to use checksums |
fd5dbd45269d1d74c540bdd72b028bedaa02383d5f19eb9c6f0e7a91149a9df5
|
|
BLAKE2b-256 checksum How to use checksums |
83737349e71715f0dfdcaa4b7f9188472c2478bbd613dd3eed7dde3c9152f4f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.17
|
Release files / pylibtermkey-0.3.1-cp35-cp35m-manylinux2014_x86_64.whl
| Download URL | pylibtermkey-0.3.1-cp35-cp35m-manylinux2014_x86_64.whl |
|---|---|
| Size | 300.4 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
dd9614397b10ccc1f1dffe53df3367845c6fdb37c615a07800c966ccd0030753
|
|
BLAKE2b-256 checksum How to use checksums |
6383152d2f140db90ef1134999a068e3e640096181f2c8ffbbe37886da253985
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.7
|
Release files / pylibtermkey-0.3.1-cp35-cp35m-macosx_10_13_intel.whl
| Download URL | pylibtermkey-0.3.1-cp35-cp35m-macosx_10_13_intel.whl |
|---|---|
| Size | 120.7 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc macOS 10.13+ Intel (x86-64, i386) |
|
SHA-256 checksum How to use checksums |
3125e22b2fc974dcdc17e2ad633b8abcb5b41018fbbc177b85b15f49bcbfd335
|
|
BLAKE2b-256 checksum How to use checksums |
9d25883f3f1fc39def16200e89979e5b32d3c7e6b78c5f930f4c1525e8f88423
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.17
|