Skip to main content

GNU Readline-like line editing module

Project description

A Python module that provides GNU Readline-like line editing functions (the default Emacs-style ones). If you just want to use Readline, use the readline package in the standard library–but this package allows access to those capabilties in settings outside of a standard CLI.

Currently, all stateless Readline commands are implemented. This means that yanking and history are not supported.

This module is especially well-suited to interfacing with Urwid due to a shared syntax for describing key inputs.

Installation

Install or upgrade to the latest version from PyPI:

[sudo] pip install -U readlike

Quick example

Transpose words:

>>> import readlike
>>> readlike.edit('perilous siege', 9, 'meta t')
('siege perilous', 14)

Commands

Implemented commands and their correspondings keys are as follows:

backward-char            ctrl b, left
backward-delete-char     ctrl h, backspace
backward-kill-word       ctrl meta h, meta backspace
backward-word            meta b, meta left
beginning-of-line        ctrl a, home
capitalize-word          meta c
delete-char              ctrl d, delete
delete-horizontal-space  meta \
downcase-word            meta l
end-of-line              ctrl e, end
forward-char             ctrl f, right
forward-word             meta f, meta right
kill-line                ctrl k
kill-word                meta d, meta delete
transpose-chars          ctrl t
transpose-words          meta t
unix-line-discard        ctrl u
unix-word-rubout         ctrl w
upcase-word              meta u

For more information about each command, see readline(3) or see the doc strings in readlike.py.

Projects using Readlike

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

readlike-0.1.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

readlike-0.1.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file readlike-0.1.3.tar.gz.

File metadata

  • Download URL: readlike-0.1.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for readlike-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4486ba5f1c1770dc6458316ecb95ea12e1ba7f59f328804fa17a8212b743fc08
MD5 95fe69ddd0f17ba88e63419bb4310ea1
BLAKE2b-256 2b2d8b281b3c2c14efd4105f90a83d886a69c8a1f6d6c2c20f1c55a8d65822ce

See more details on using hashes here.

File details

Details for the file readlike-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for readlike-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a87a179ac7badc174883d88baddb37a5f8cbb4fe533a5fa2ffc3563b14fe2601
MD5 c518ab884431859ba413d8cff219b858
BLAKE2b-256 7102d639167c3ed84b9c3040bc99ed97be67796b53635f0c4f23392918428324

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