Metadata-Version: 2.1
Name: context-verbose
Version: 2.0.0
Summary: Tool to simply display information about the state of the code during its execution.
Home-page: https://framagit.org/robinechuca/context-verbose/-/blob/main/README.rst
Author: Robin RICHARD (robinechuca)
Author-email: raisin@ecomail.fr
License: UNKNOWN
Project-URL: Source Repository, https://framagit.org/robinechuca/context-verbose/
Keywords: display,print,verbose,context,printer,block,context-printer,debug
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Printing
Classifier: Topic :: Software Development :: Bug Tracking
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Terminals
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
Provides-Extra: tests
Provides-Extra: documentation
License-File: LICENSE


***********************************************************
Library to improve the display of your code in the console.
***********************************************************

By adding only a few lines of code at strategic places in your program, you will get a nice console display that will let you know what stage your code is at.

fork of ``context-printer``:
----------------------------

This project is a fork of the `context_printer <https://pypi.org/project/context-printer/>`_ project. The philosophy of this project is strictly the same as the original project. Nevertheless, this project offers the following improvements:

* Support for the ``with`` keyword (context manager).
* Formatting of exceptions for better debugging.
* Added decorator behavior.
* Possibility to implicitly name a section.
* More formatting possible (adding highlighting and flashing).

Basic usage example:
--------------------

.. code:: python

    from context_verbose import printer as ctp
    with ctp('Main Section', color='blue'):
        ctp.print('Text in main section')
        for i in range(3):
            with ctp(f'Subsection {i}'):
                ctp.print('Text in subsection')
                ctp.print('Text in subsection')

The above example will print the following:

.. figure:: https://framagit.org/robinechuca/context-verbose/-/raw/main/basic_example.png

Exaustive example of usage:
---------------------------

.. code:: python

    from context_verbose import printer as ctp

    @ctp
    def decorated_func(x):
        return x**x**x

    def error_func():
        with ctp('Section that will fail'):
            return 1/0

    ctp.print('we will enter the main section')
    with ctp('Main Section', color='cyan'):
        ctp.print('text in main section')
        try:
            with ctp('Subsection 1'):
                for x in [1, 8]:
                    decorated_func(x)
                error_func()
        except ZeroDivisionError:
            pass
        with ctp('Subsection 2', color='magenta'):
            ctp.print('text in bold', bold=True)
            ctp.print('underlined text', underline=True)
            ctp.print('blinking text', blink=True)
            ctp.print('yellow text', color='yellow')
            ctp.print('text highlighted in blue', bg='blue')
            ctp.print('text in several ', end='')
            ctp.print('parts', print_headers=False)
            ctp.print('''text in several
                         lines''')
        with ctp(color='green'):
            ctp.print('this subsection is automatically named')
    ctp.print('we are out of the main section')

The above example will print the following:

.. figure:: https://framagit.org/robinechuca/context-verbose/-/raw/main/exaustive_example.png


