From fa30ea858d0ac41f2f542e0c50d9f9a2e343deb2 Mon Sep 17 00:00:00 2001 From: Daniel Santos Date: Tue, 10 Dec 2019 00:04:03 +0100 Subject: =?UTF-8?q?Implement=20feature=20that=20allows=20to=20export=20tab?= =?UTF-8?q?ular=20data=20suited=20to=20a=E2=80=A6=20(#437)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/formats.rst | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/formats.rst b/docs/formats.rst index 42b8cd5..9db94ce 100644 --- a/docs/formats.rst +++ b/docs/formats.rst @@ -7,6 +7,29 @@ Formats Tablib supports a wide variety of different tabular formats, both for input and output. Moreover, you can :ref:`register your own formats `. +cli +=== + +The ``cli`` format is currently export-only. The exports produce a representation +table suited to a terminal. + +When exporting to a CLI you can pass the table format with the ``tablefmt`` +parameter, the supported formats are:: + + >>> import tabulate + >>> list(tabulate._table_formats) + ['simple', 'plain', 'grid', 'fancy_grid', 'github', 'pipe', 'orgtbl', + 'jira', 'presto', 'psql', 'rst', 'mediawiki', 'moinmoin', 'youtrack', + 'html', 'latex', 'latex_raw', 'latex_booktabs', 'tsv', 'textile'] + +For example:: + + dataset.export("cli", tablefmt="github") + dataset.export("cli", tablefmt="grid") + +This format is optional, install Tablib with ``pip install tablib[cli]`` to +make the format available. + csv === @@ -100,7 +123,7 @@ latex Import/export using the LaTeX_ format. This format is export-only. If a title has been set, it will be exported as the table caption. - + .. _LaTeX: https://www.latex-project.org/ ods -- cgit v1.2.1