import json
import os
import pandas

opcvs = open('/home/wcmckee/Downloads/convertcsv.json', 'r')

opzrd = opcvs.read()

jdunp = json.loads(opzrd)

valia = []

#pandas.read_json(jdunp)

jdunp.count(int)

len(jdunp)

"""
Explanation: <h1>lcacoffee</h1>

script that displays coffees sold by hour at lca2015.
Currently it opens a .json file and converts it into a python dict.
End of explanation
"""


for numtwn in range(0,24):
    print "'" + str(numtwn) + "'"

for jdr in jdunp:
    print jdr['0']

for numtwn in range(0,24):
        print "'" + str(numtwn) + "'"

for dej in jdunp:
    print dej.values()
    valia.append(dej.values())

dezrand = len(valia)

azlis = []

for vals in valia:    
    print vals
    azlis.append(vals)

"""
Explanation: ok if i cycle through jdunp between 0 and 23 i get the results.
cycle through ints but as a string. must add ' '
End of explanation
"""


betra = []

for azl in azlis:
    betra.append(azl)

anoe = []
anez = []

for betr in betra:
    betr.append(anoe)

for deta in betr:
    #print deta
    if '- -' in deta:
        print deta
    else:
        anez.append(deta)

fdic = []

for resut in anez:
    print resut
    fdic.append(resut)

"""
Explanation: I need to filter the - - from the results. I really only need the values that have numbers. 
Take number in brackets away from number not in brackets. 
The number in brackets is total amount of coffees sold. The number not in brackets is amount of volchers used. 
The number that I get when i take away is the coffee sold without volchers. 
New dict that shows only the times that coffee were sold and the amount of coffgfges that were solf. Maybe that would works.
End of explanation
"""


fdic

"""
Explanation: How come it is only adding the wednesday data in the results. It needs to have all the datas. 
Needs to take the number in brackets away from the number not in brackets.
End of explanation
"""


