cinematools/stats.py

29 lines
932 B
Python
Raw Normal View History

2013-07-01 10:06:47 +00:00
import json
import sys
2013-08-08 08:18:12 +00:00
if len(sys.argv) != 2:
print "usage: %s idsofcountry.json" % sys.argv[0]
2013-07-01 10:06:47 +00:00
sys.exit(1)
idsofcountry = sys.argv[1]
data = json.load(open(idsofcountry))
2013-08-08 08:18:12 +00:00
mini_series = filter(lambda x: 'Mini-Series' in x['title'], data)
tv_series = filter(lambda x: 'TV Series' in x['title'], data)
tv_movies = filter(lambda x: 'TV Movie' in x['title'], data)
tv_special = filter(lambda x: 'TV Special' in x['title'], data)
2016-04-29 11:02:16 +00:00
documentary = filter(lambda x: 'Documentary' in x['title'], data)
2013-07-01 10:06:47 +00:00
#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'
2016-04-29 11:02:16 +00:00
print len(documentary), 'Documentaries'
2013-07-01 10:06:47 +00:00
#print len(cinema), 'Cinema'
2016-04-29 11:02:16 +00:00
print len(data) - len(mini_series) - len(tv_movies) - len(tv_series) - len(tv_special) - len(documentary), 'Movies'
2013-07-01 10:06:47 +00:00
print len(data), 'total'