1. pytablewriter¶
1.1. Summary¶
pytablewriter is a Python library to write a table in various formats: AsciiDoc / 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:
- Text formats:
CSV / Tab-separated values (TSV) / Space-separated values (SSV)
HTML / CSS
JSON / Line-delimited JSON(LDJSON)
LaTeX:
tabular
/array
environmentMarkdown: CommonMark / GitHub Flavored Markdown (GFM) / kramdown
reStructuredText: Grid Tables/Simple Tables/CSV Table
- Source code (definition of a variable that represents tabular data)
JavaScript / NumPy (numpy.array) / Pandas (pandas.DataFrame) / Python
Unicode
- Binary file formats:
Microsoft Excel TM (
.xlsx
/.xls
file format)pandas.DataFrame pickle file
SQLite database
- Application specific 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:
nested list
CSV
etc.
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 example |
Remark |
---|---|
|
Elasticsearch |
|
Excel |
|
HTML |
|
SQLite database |
|
TOML |
|
pytablewriter theme plugins |
|
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¶
logging
extrasloguru: Used for logging if the package installed
from
extras
es
extra
excel
extras
html
extras
sqlite
extras
theme
extras
toml
extras