CLI tool
TTP comes with simple CLI tool that takes path to data, path to template and produces parsing results. Results can be represented in one of formats supported by CLI tool - yaml, json, raw or pprint, results will be printer to screen. Alternatively, format can be specified using template output tags and printed to screen or returned to file using returners.
Sample usage:
ttp --data "/path/to/data/" --template "path/to/template.txt" --outputter json
results will be printed to screen in JSON format.
Available options
-d, --dataPath to data file or directory with files to process-dp, --data-prefixOS base path to folder with data separated across additional folders as specified in TTP input tags-t, --templatePath to text file with template content-tn, --template-nameName of template within file referenced by -t option if file has python (.py) extension-o, --outputterFormat results using yaml, json, raw or pprint formatter and prints them to terminal-ot, --out-templateName of template to output results for-l, --loggingLogging level - “DEBUG”, “INFO”, “WARNING”, “ERROR”, “CRITICAL”-lf, --log-fileOS path to file where to write logs instead of printing them to terminal-T, --TimingPrint simple timing information to screen about time spent on parsing datas, --structureFinal results structure - ‘list’, ‘dictionary’ or ‘flat_list’-v, --varsJSON string containing variables to add to TTP object--oneForcefully run parsing using single process--multiForcefully run parsing in multiple processes