Skip to content

Instantly share code, notes, and snippets.

@holtwick
Created December 7, 2010 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save holtwick/732174 to your computer and use it in GitHub Desktop.
Save holtwick/732174 to your computer and use it in GitHub Desktop.
Analyze AppStore Daily Reports
import glob
d = {}
for fn in glob.glob('appsales/*.txt'):
lines = open(fn, 'r').readlines()[1:]
# print fn
for l in lines:
l = l.split('\t')
if len(l) == 18: # only newest format
proceeds = float(l[8])
customerPrice = float(l[15])
country = l[12]
if proceeds > 0 and l[11]==l[13]: # and country not in d:
# print country, proceeds, customerPrice, l, fn
d[country] = d.get(country, []) + [proceeds / customerPrice]
for k in sorted(d.keys()):
print "%s %.2f%%" % (k, d[k][0] * 100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment