Metadata-Version: 2.0
Name: redirect-streams
Version: 0.0.1.dev20150819180421
Summary: Easy stream redirection in Python.
Home-page: https://github.com/jambonrose/redirect_streams
Author: Andrew Pinkham
Author-email: hello at andrewsforge dot com
License: Simplified BSD License
Keywords: stream,stdout,stderr,with,context managers
Platform: UNKNOWN
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4

`Package Documentation`_

Description
-----------

This project provides Python context managers to help redirect multiple
forms of output into a buffer (capturing the output).

Installation
------------

.. code:: console

    $ pip install redirect-streams

Basic Usage
-----------

The most common use of this project is to redirect ``stdout``.

.. code:: python

    from io import BytesIO, SEEK_SET, TextIOWrapper
    from sys import stdout

    from redirect_streams import redirect_stdout

    with TextIOWrapper(BytesIO(), stdout.encoding) as buffer:
        with redirect_stdout(buffer):
            print('this will be saved in the buffer')
        buffer.seek(SEEK_SET)
        saved = buffer.read()
    print(saved)

For other context managers and more detailed information, please refer
to the `documentation`_.

.. _`documentation`: https://redirect-streams.readthedocs.org/
.. _`Package Documentation`: `documentation`_


