<jupyter_start><jupyter_text>RevCoffeeReverse Coffee Sales SystemThis is a script to create coffee sales data. It uses the same base template as lcacoffee.ipnb.Create a dict with coffee data in Sell a product = +1 to salesCash register base.Hour, Daily, Monthly, Annual sales data of each item.10 cents, 20cents, 50cents, 1dollar, 2dollar,5 dollar, 10 dollar, 20 dollar, 50 dollar, 100 dollar.Point of sale open source project.<jupyter_code>import arrow
import os
#I need it to return the day of the week it is.
#etc. Monday, Tuesday, Wednesday, Thursday
arut = arrow.utcnow()
cofdat = dict()
#cofdat
#Add a product.
yop = raw_input('add new product? y/n ')

if 'y' in yop:
    newprod = raw_input('Enter new product: ')

    strprod = str(newprod)
    #dicprod = dict
else:
    print 'not adding new product'
yepz = raw_input('sell a product? y/n ')
#input product type to sell.
if 'y' in yepz:
    lios = os.listdir('/home/wcmckee/sellcoffee/products/')
    print lios
    useprod = raw_input('Sell What? ')
    useprod
#dict({"test": "again"})
print arut.date()
print arut.time()
arut.weekday()
cofdat.update({'Day': arut.weekday()})
cofdat.update({'Date': str(arut.date())})
print cofdat
#for dayhr in range(24):
    #print dayhr
#    cofdat.update({dayhr: ' '})
twenforst = arut.strftime('%H')
twenforst
lisprod = ('/home/wcmckee/sellcoffee/products/')
os.listdir(lisprod)
#Type in shortcuts for selecting items from list.
#id is code for what you can input in order to choose a
#product.
opnumco = open('/home/wcmckee/sellcoffee/products/internet', 'r')

oprz = opnumco.read()
#Need to +1 to this number 
salnumz = int(oprz) + 1
salnumz
savopnum = open('/home/wcmckee/sellcoffee/products/internet', 'w')

savopnum.write(str(salnumz))
savopnum.close()
cofdat.update({twenforst: salnumz})
#cofdat.update({twenforst : numup
cofdat
cofdat.update({twenforst: 1})
#Get value [hour of the day] of key [amount sold]
#Whats the point in creating keys for hours that don't
#get sales. Just get it to update with hour and add it

#Value is a database on the coffee sale. 
#Currently just numbers.
print cofdat
sincofd = dict()
import getpass
gusr = getpass.getuser()
gusr
#Outlet is username of sales person
#Product is coffee name. 
#Open and read file that the customer asks
#for type of coffee. 
#Have a order folder that coffees are 
#qued into. 
#Sellcoffee folder
#Usernames - customers
#Staff - Staff list
#opctype = open('/home/wcmckee/sellcoffee/usernames/')
coftag = ('coffee, soymilk')
idnum = 1000
#Amount of coffee sales
cofsal = salnumz
salstot = 4 * salnumz
#New product id will be os.listdir products len 
#1000 + products len
#This will increase by 1 each time a new product is added.
#Product ids start from 1000 or higher?
amofp = len(os.listdir(lisprod))
neidfp = (amofp + 1000)
neidfp
#Dict of new product created with this script. 
#Dict is stored with folder of product.
#Details on when product was first created
#It's name, ID, tags, sales counts.

sincofd.update({'Outlet': gusr})

sincofd.update({'Product': strprod})

sincofd.update({'ID': neidfp})
#Tags for this sale. 
sincofd.update({'tags': coftag})
#Sales count of that product
sincofd.update({'count': salnumz})
sincofd.update({'sales': salstot})
sincofd
#Need a list of coffee types
#and assign ID to each coffee.
strprod
savprod = open('/home/wcmckee/sellcoffee/products/' + strprod, 'w')

savprod.write('1')

savprod.close()
#strzict = dict({'test':'again'})
#strzict
dictprod = dict()
#Add internet. Adds computer time to a account.
dictprod.update({newprod: sincofd})
print dictprod<jupyter_output>{'vogals': {'count': 11, 'Product': 'vogals', 'Outlet': 'wcmckee', 'tags': 'coffee, soymilk', 'ID': 1007, 'sales': 44}}
{'fraction_non_alphanumeric': 0.12537152121048364, 'fraction_numerical': 0.013780059443393677, 'mean_word_length': 4.766355140186916, 'pattern_counts': {'":': 1, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '176226', 'license': 'MIT', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1320, 'n_words': 450, 'path': 'revcoffee.ipynb', 'repo_name': 'wcmckee/lcacoffee', 'size': '3701'}