Convert various data formats to reStructuredText tables.
- CSV
- JSON
Planned formats:
- Excel
installation
PyPI
pip install toRST
example
Convert file1.csv and file2.json into RST
torst file1.csv file2.json -o /outputfolder
inputs One or more input files to convert to RST. Currently only CSV and JSON files are supported, but additional formats will be added.
-o, --output_dir Output directory for generated RST files. Defaults to the current working directory if not provided.
example
Import Table class
from toRST.toRST import Table
Convert file1.csv into RST string
rst_table = Table('file1.csv').build_table()
Can also convert list[list or tuple or dict] and dict[str, list]
into RST by passing the object into the Table
class
While building mlb-positive-ev, I wanted a quick and readable output of a SQLite query and couldn't find anything suitable.