<commit_before>Quickstart
==========

Displaying Tabular Data
-----------------------


The Basics
++++++++++

CLI Helpers provides a simple way to display your tabular data (columns/rows) in a visually-appealing manner::

    >>> from cli_helpers import tabular_output

    >>> data = [[1, 'Asgard', True], [2, 'Camelot', False], [3, 'El Dorado', True]]
    >>> headers = ['id', 'city', 'visited']

    >>> print(tabular_output.format_output(data, headers, format_name='simple'))
      id  city       visited
    ----  ---------  ---------
       1  Asgard     True
       2  Camelot    False
       3  El Dorado  True

Let's take a look at what we did there.

1. We imported the :mod:`~cli_helpers.tabular_output` module. This module gives us access to the :func:`~cli_helpers.tabular_output.format_output` function.

2. Next we generate some data. Plus, we need a list of headers to give our data some context.

3. We format the output using the display format ``simple``. That's a nice looking table!


Display Formats
+++++++++++++++

To display your data, :mod:`~cli_helpers.tabular_output` uses
`tabulate <https://bitbucket.org/astanin/python-tabulate>`_,
`terminaltables <https://robpol86.github.io/terminaltables/>`_, :mod:`csv`,<commit_msg>Add extra blank line for first quickstart example.<commit_after>Quickstart
==========

Displaying Tabular Data
-----------------------


The Basics
++++++++++

CLI Helpers provides a simple way to display your tabular data (columns/rows) in a visually-appealing manner::

    >>> from cli_helpers import tabular_output

    >>> data = [[1, 'Asgard', True], [2, 'Camelot', False], [3, 'El Dorado', True]]
    >>> headers = ['id', 'city', 'visited']

    >>> print(tabular_output.format_output(data, headers, format_name='simple'))

      id  city       visited
    ----  ---------  ---------
       1  Asgard     True
       2  Camelot    False
       3  <NAME>  True

Let's take a look at what we did there.

1. We imported the :mod:`~cli_helpers.tabular_output` module. This module gives us access to the :func:`~cli_helpers.tabular_output.format_output` function.

2. Next we generate some data. Plus, we need a list of headers to give our data some context.

3. We format the output using the display format ``simple``. That's a nice looking table!


Display Formats
+++++++++++++++

To display your data, :mod:`~cli_helpers.tabular_output` uses
`tabulate <https://bitbucket.org/astanin/python-tabulate>`_,
`terminaltables <https://robpol86.github.io/terminaltables/>`_, :mod:`csv`,
{'fraction_non_alphanumeric': 0.16765285996055226, 'fraction_numerical': 0.008678500986193294, 'mean_word_length': 3.2479061976549413, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 32, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3919327', 'n_tokens_mistral': 778, 'n_tokens_neox': 760, 'n_words': 261}