def getviviz(**kwargs):
    """Download ViViz web application"""
    import shutil
    import zipfile
    from hapiclient.util import system, download
    url = 'https://github.com/rweigel/viviz/archive/master.zip'
    file = kwargs['cachedir'] + '/viviz-master.zip'
    if shutil.which('git'):
        code, stderr, stdout = system(
            'git clone https://github.com/rweigel/viviz.git ' + kwargs[
            'cachedir'] + '/viviz')
        if kwargs['loglevel'] == 'debug':
            print(code, stderr, stdout)
    else:
        download(file, url)
        zipref = zipfile.ZipFile(file, 'r')
        zipref.extractall(kwargs['cachedir'])
        zipref.close()
