Skip to content

Output Specification

Myles edited this page Nov 2, 2018 · 4 revisions

QAMD currently offers two output formats, the first JavaScript Object Notation (JSON) and Hypertext Markup Language (HTML). JSON is aimed at providing a simple way to integrate other applications with QAMD while the HTML output is geared to be human readable.

HTML

To generate HTML simply append --output-format html to the end of the command. The HTML output isn't directly readable from the terminal and as such works best when paired with the --output switch. For example to generate HTML from a Stata file and save it to a file called out.html:

qamd path/to/file.dta --output-format html --output out.html

The resulting HTML web page is best viewed in Firefox, Chrome or Safari browsers. Internet Explorer & Edge just don't seem to make the cut sometimes.

The results are display in a tabular format, each row represents a check. Green highlighting representing checks that passed fully and red denoting checks that failed. If you included the --include-locators switch, clicking on a failed check will show you the variable (name & index), the and if applicable the row (index only) where it failed.

JSON

JSON is the default output format for QAMD as JSON provides a strong machine readable intermediary and allows for integration with with Web based clients much easier. While JSON is the default, you can still explicitly state the output format with the --output-format switch.

{
    "metadata": {
        "file_name": "mtcars.dta",
        "raw_case_count": 32,
        "case_count": 0,
        "variable_count": 12,
        "creation_time": 1519986540,
        "modified_time": 1519986540,
        "file_label": "",
        "file_format_version": 118,
        "file_encoding": null,
        "compression": "None"
    },
    "summary": {
        "missing_variable_labels": {
            "pass": 0,
            "fail": 12,
            "desc": "Variables should have a label.",
            "locator": [
                {
                    "variable_name": "carb",
                    "variable_index": 11,
                    "value_index": -1
                },
                {
                    "variable_name": "hp",
                    "variable_index": 4,
                    "value_index": -1
                },
                ...
            ]
        },
        "variable_odd_characters": {
            "pass": 12,
            "fail": 0,
            "desc": "Variable names and lables cannot contain certain 'odd' characters. [\"!\", \"#\", \"  \", \"@\", \"ë\", \"ç\", \"ô\", \"ü\"]",
            "locator": null
        }
    }
}
Clone this wiki locally