Skip to content
/ toRST Public

Pip installable Python package and CLI to convert a number of different file formats into reStructuredText

License

Notifications You must be signed in to change notification settings

jrey999/toRST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toRST

Convert various data formats to reStructuredText tables.

Currently supports:

  • CSV
  • JSON

Planned formats:

  • Excel

installation PyPI

pip install toRST

CLI Usage

example
Convert file1.csv and file2.json into RST

torst file1.csv file2.json -o /outputfolder

Positional Arguments:

inputs One or more input files to convert to RST. Currently only CSV and JSON files are supported, but additional formats will be added.

Optional Arguments:

-o, --output_dir Output directory for generated RST files. Defaults to the current working directory if not provided.

Python Usage

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

What toRST was built for

While building mlb-positive-ev, I wanted a quick and readable output of a SQLite query and couldn't find anything suitable.

About

Pip installable Python package and CLI to convert a number of different file formats into reStructuredText

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages