This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

pygnurl is a dynamic GNU Readline interface. It provides:

  • A Pythonic interface similar to rl for ease of use
  • An interface to custom bindable functions
  • A readline compatibility layer for existing code

You should use pygnurl if you specifically want to use GNU Readline from your Python program. If you are just looking for tools to help you build a command line interface, you may prefer prompt_toolkit.

Requirements

pygnurl dynamically loads a Readline library, so you need a version matching the architecture of your Python interpreter (not necessarily your system).

Linux users should already have Readline as part of the standard library. pygnurl uses this version by default.

Windows users can get a pre-built 32-bit Readline DLL from gnuwin32.

More information on where to get Readline can be found on the Readline home page.

Quick Start Guide

Install pygnurl using pip install pygnurl.

Set the PYGNURL_LIB environment variable to the filename of your Readline library. This will be loaded using the shared library search order rules of your system. (Linux users can skip this step to use the system version).

If your version of Python already has a readline module, you will need to do one of the following things to let pygnurl override it:

  1. Add <site-packages>/pygnurl/modules to your PYTHONPATH environment variable
  2. Install using easy_install instead of pip

If you are using Python 3.4 or later, completion and history will be set up for you automatically. If you are using an older version, you will need to set this up yourself.

>>> import rlcompleter
>>> import readline
>>> readline.parse_and_bind('tab: complete')
>>> r<tab><tab>

Examples

pygnurl/examples/startup.py - An example startup file suitable for everyday use. Point the PYTHONSTARTUP environment variable at this file to automatically get tab completion and saved history in your interpreter. (If you are using Python 3.4 or later, you do not need to use this example.)

pygnurl/examples/functions.py - An example startup file demostrating a custom bindable command. You must also use this with the PYTHONSTARTUP environment variable. Run help(pygnurl.examples.functions) for more information.

pygnurl/examples/mycmd.py - A simple command line showing tab completion capabilities. The argument to cat is completed based on your local filesystem.

Motivation

pygnurl aims to provide full GNU Readline support across all platforms with no compilation overhead. Any pre-built Readline library should be able to be dropped in with no code modifications. If necessary, version- or platform-specific compatibility fixes can be implemented in Python, not C.

Development

For source code, questions and bug reports, visit the GitHub repository:

https://github.com/evanunderscore/pygnurl

Alternatives

readline - Part of the standard library. Python on Mac OS X may implement this using libedit instead of GNU Readline and must be configured accordingly.

pyreadline - A python implmentation of GNU readline.

gnureadline - The standard Python readline extension statically linked against the GNU readline library.

rl - Alternative Python bindings for GNU Readline.

prompt_toolkit - Library for building powerful interactive command lines in Python.

  Platforms Library Interface
pygnurl Any Dynamic Extended
readline Unix-like Static Basic
pyreadline Windows Pure Python Basic
gnureadline Unix-like Static Basic
rl Unix-like Static Extended
prompt_toolkit Any Pure Python Alternative

Known Bugs

  • ANSI color codes in the IPython terminal are not able to be printed. As a workaround, the codes are stripped and a plain prompt is displayed instead.
  • libreadline6 from MinGW lags behind one keystroke when using the arrow keys. This appears to be related to the Readline callback interface.
Release History

Release History

1.0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.8.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pygnurl-1.0.1-py2.py3-none-any.whl (26.1 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Feb 6, 2016
pygnurl-1.0.1.zip (36.6 kB) Copy SHA256 Checksum SHA256 Source Feb 6, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting