cinematools/stats.py
2013-07-01 12:06:47 +02:00

26 lines
783 B
Python

import json
import sys
if len(sys.args) != 2:
print "usage: %s idsofcountry.json" % sys.args[0]
sys.exit(1)
idsofcountry = sys.argv[1]
data = json.load(open(idsofcountry))
mini_series = filter(lambda x: 'Mini-Series' in x[1], data)
tv_series = filter(lambda x: 'TV Series' in x[1], data)
tv_movies = filter(lambda x: 'TV Movie' in x[1], data)
tv_special = filter(lambda x: 'TV Special' in x[1], data)
#cinema = set(data) - set(mini_series) - set(tv_series) - set(tv_movies)
print len(tv_special), 'TV Specials'
print len(tv_series), 'TV Series'
print len(tv_movies), 'TV Movies'
print len(mini_series), 'Mini-Series'
#print len(cinema), 'Cinema'
print len(data) - len(mini_series) - len(tv_movies) - len(tv_series) - len(tv_special), 'Movies'
print len(data), 'total'