1. pytablewriter

PyPI package version conda-forge package version Supported Python versions Supported Python implementations Linux/macOS/Windows CI status Test coverage

1.1. Summary

pytablewriter is a Python library to write a table in various formats: CSV / Elasticsearch / HTML / JavaScript / JSON / LaTeX / LDJSON / LTSV / Markdown / MediaWiki / NumPy / Excel / Pandas / Python / reStructuredText / SQLite / TOML / TSV / YAML.

1.2. Features

  • Write a table in various formats:
  • Automatic table cell formatting:
    • Alignment

    • Padding

    • Decimal places of numbers

  • Customize table cell styles:
    • Text/Background color

    • Text alignment

    • Font size/weight

    • Thousand separator for numbers: e.g. 1,000/1 000

  • Configure output:
    • Write table to a stream such as a file/standard-output/string-buffer/Jupyter-Notebook

    • Get rendered tabular text

  • Data sources:
  • Multibyte character support

  • ANSI color support

2. Installation

2.1. Installation: pip

pip install pytablewriter

Some of the formats require additional dependency packages, you can install these packages as follows:

Installation of optional dependencies

Installation example


pip install pytablewriter[es]


pip install pytablewriter[excel]


pip install pytablewriter[html]


pip install pytablewriter[sqlite]

SQLite database

pip install pytablewriter[toml]


pip install pytablewriter[theme]

pytablewriter theme plugins

pip install pytablewriter[all]

Install all of the optional dependencies

2.2. Installation: conda

conda install -c conda-forge pytablewriter

2.3. Installation: apt

sudo add-apt-repository ppa:thombashi/ppa
sudo apt update
sudo apt install python3-pytablewriter

3. Dependencies

3.1. Optional dependencies