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

A $PAGER in pure Python

pip install pypager

Pypager can be used as a stand-alone application, or as a library.

What is a pager?

A pager is a terminal program that can be used to view the content of a file, or the output stream from another application.

For instance, when we run man vim, the actual content is displayed in a pager, according to the $PAGER environment variable.

Important for a pager is that the input can be streamed. For instance when we execute find / | pypager; we don’t want to wait for the whole file system to be traversed, before displaying anything. Data is only read from the input pipe, when it needs to be displayed.

Popular pager applications are more, less and most.

Features

  • Highlighting of text [0].
  • Searching.
  • Many key bindings from less are implemented.

[0] (It understands the output of man pages, ANSI escape codes and further, it can use Pygments to highlight about any file.)

Usage

# Install it.
pip install pypager

# Tell the environment to use this pager. Put the following line in
# ~/.bashrc if you like.
export PAGER=pypager

# Following commands, and many others should pick up the pager.
man vim
git diff

# View a file, using this pager.
pypager some_source_code.py

As a library

from pypager.source import GeneratorSource
from pypager.pager import Pager
from prompt_toolkit.token import Token


def generate_a_lot_of_content():
    """
    This is a function that generates content on the fly.
    It's called when the pager needs to display more content.
    """
    counter = 0
    while True:
        yield [(Token, 'line: %i\n' % counter)]
        counter += 1


if __name__ == '__main__':
    source = GeneratorSource(generate_a_lot_of_content())
    p = Pager(source)
    p.run()
Release History

Release History

0.2

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

0.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

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
pypager-0.2-py2-none-any.whl (18.7 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Jun 20, 2016
pypager-0.2-py3-none-any.whl (18.7 kB) Copy SHA256 Checksum SHA256 3.6 Wheel Jun 20, 2016
pypager-0.2.tar.gz (13.6 kB) Copy SHA256 Checksum SHA256 Source Jun 20, 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