<commit_before># Mustang 

[![Build Status](https://secure.travis-ci.org/stomita/mustang.png)](http://travis-ci.org/stomita/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

<pre>
  $ npm install -g mustang
</pre>

or

<pre>
  $ git clone git://github.com/stomita/mustang.git 
  $ cd mustang
  $ npm link
</pre>

## 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.

<pre>
  $ mustang -t &lt;template_file&gt; -i &lt;input_file&gt;
</pre>

Following is an example to output html from a CSV file input.

<pre>
  $ cat input.csv
  NO,TITLE
  1,"Hello, World"
  2,"Apple, Orange, and Banana"
  3,"Thank you!"

  $ cat template.mustache
  {{#.}}
  &lt;div&gt;{{NO}}: {{TITLE}}&lt;/div&gt;
  {{/.}}

  $ mustang -t template.mustache -i input.csv
  &lt;div&gt;1: Hello, World&lt;/div&gt;
  &lt;div&gt;2: Apple, Orange, and Banana&lt;/div&gt;
  &lt;div&gt;3: Thank you!&lt;/div&gt;
</pre>

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.

<pre>
  $ cat input.txt
  [
    { "NO": 1, "TITLE": "Hello, World" },
    { "NO": 1, "TITLE": "Apple, Orange, and Banana" },
    { "NO": 1, "TITLE": "Thank you!" }
  ]

  $ mustang -t template.mustache -i input.txt -f json<commit_msg>fix content in README.md<commit_after># Mustang 

[![Build Status](https://secure.travis-ci.org/stomita/mustang.png)](http://travis-ci.org/stomita/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

<pre>
  $ npm install -g mustang
</pre>

or

<pre>
  $ git clone git://github.com/stomita/mustang.git 
  $ cd mustang
  $ npm link
</pre>

## 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.

<pre>
  $ mustang -t &lt;template_file&gt; -i &lt;input_file&gt;
</pre>

Following is an example to output html from a CSV file input.

<pre>
  $ cat input.csv
  NO,TITLE
  1,"Hello, World"
  2,"Apple, Orange, and Banana"
  3,"Thank you!"

  $ cat template.mustache
  {{#.}}
  &lt;div&gt;{{NO}}: {{TITLE}}&lt;/div&gt;
  {{/.}}

  $ mustang -t template.mustache -i input.csv
  &lt;div&gt;1: Hello, World&lt;/div&gt;
  &lt;div&gt;2: Apple, Orange, and Banana&lt;/div&gt;
  &lt;div&gt;3: Thank you!&lt;/div&gt;
</pre>

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.

<pre>
  $ cat input.txt
  [
    { "NO": 1, "TITLE": "Hello, World" },
    { "NO": 2, "TITLE": "Apple, Orange, and Banana" },
    { "NO": 3, "TITLE": "Thank you!" }
  ]

  $ mustang -t template.mustache -i input.txt -f json
{'fraction_non_alphanumeric': 0.1437216338880484, 'fraction_numerical': 0.005446293494704993, 'mean_word_length': 3.676096181046676, 'pattern_counts': {'":': 12, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1131428', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1164, 'n_words': 388}