#!/usr/bin/env python

import click
import json
import lib
import shutil

@click.command()
@click.argument('json_file', nargs=1)
@click.argument('keys', nargs=-1)
def probe(json_file, keys=[]):
    with open(json_file) as f:
        data = json.load(f)
    for key in keys:
        data = data[key]

    if type(data) is dict:
        num_keys = len(data.keys())
        print ">>".join(keys), ":", data.keys()[:150]
        print "(total %s keys)" % str(num_keys)
    else:
        print ">>".join(keys), ":", type(data)

    try:
        print "Data length:", len(data)
    except:
        pass


if __name__=="__main__":
    probe()
