mustang v0.1.3
Mustang
A command-line tool for mustache template, generating outputs from various data sources
Abstract
Mustang is a command-line tool to generate desired outputs from various data sources (e.g. CSV/JSON file, URL, MySQL, MongoDB), by applying mustache template.
Install
or
Usage
Following is a very simple command to generate output to stdout from specified mustache template by using the input file as its templating context.
Following is an example to output html from a CSV file input.
Currently input file must be formatted in CSV or JSON. By default mustang checks its file extension and detect its format. You can add '-f' option to specify input file format explicitly.
You can also use stdin for piping.
Adding '-o' option, mustang output is saved to specified file.
If you want to output multiple files from each input records, add '-m' option and set output directory path in '-o' option.
By using "-u" option, mustang downloads the content directly from specified URL and use it as input source.
Also mustang can connnect to database and query records from database table/collection. Currently MySQL and MongoDB is supported for database.
Following example shows how to fetch all records in "emp" table in MySQL database.
You can directly pass a SQL to fetch records by "-q" option.
Following example shows how to fetch all records in "users" collection in MongoDB.
You can also set URL-style query string in "-q" option to specify both querying collection and filter.
Change History
v0.1.1 (May 19, 2013):
- Added support for MongoDB data source
v0.1.0 (May 19, 2013):
- Initial Release