Python Forum
Help on a program to help with distributing food to the needy
Thread Rating:
  • 3 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help on a program to help with distributing food to the needy
#1
I am not a very experienced programmer, but i have done some coding in python. I helped distribute food from a food bank the other day, and found a major issue. Right now, we give people either a 1 or a 2 card, single person or big family. All the judging on how much food is to be given to each person based on the cards is done by guesswork, though we do have amounts on every pallet. It was the worst feeling in the world when i had to look a woman in the eyes tell a mother with a 2 card that there was no more corn, and watch her go to the share the harvest deer meat table to get the same thing, on to fruit juice, misjudged again. There was however, cases of extra lettuce and cookies. This is a pretty serious problem.

      I am looking to make a system with a simple and flexible interface to evenly distribute food that has a variety of different units. It needs to account for one and two card holders, and it needs to actively keep track of how many people are still in line, people come continuously. I would really appreciate community support on this, even if it is just a point in the right direction. It would be truly beneficial to a large number of people, we served about five hundred individual families on the last distribution. Any help would be much appreciated, i hope that i can take the help of the community and turn into a viable solution. If the solution works well, i will open source all the code and try to help other banks get it up and running, there is absolutely no intentions of profit.
Reply
#2
What country are you in?
where is this food bank located?

This will help in directing you to an open source community that will be able to help you out.
Once you start your project, you will be able to use this forum to ask questions when you have
specific problems.
Unfortunately, We do not take on complete projects.
Reply
#3
(Apr-06-2017, 02:41 AM)Larz60+ Wrote: What country are you in? where is this food bank located? This will help in directing you to an open source community that will be able to help you out. Once you start your project, you will be able to use this forum to ask questions when you have specific problems. Unfortunately, We do not take on complete projects.
Unfortunately i live in an area basically devoid of programmers, rural mid missouri, hence me asking for help here. Im in the united states.
Reply
#4
see: https://www.smashingmagazine.com/2013/01...e-project/

also https://github.com/open-source
Reply
#5
(Apr-06-2017, 03:13 AM)teenspirit Wrote: Unfortunately i live in an area basically devoid of programmers, rural mid missouri, hence me asking for help here. Im in the united states.

But this is the 21st century and we live and breath the internets :-) .

I think your post would probably be better suited for the "Jobs" section of the forum.  Before you go about re-inventing the wheel, it might pay (not in money, but time) to see what already exists...for free.  What you describe seems to point to some form of inventory control. This article might prove of interest: Inventory Management.  You might find the software you need, or perhaps help you to refine what exactly you are looking for.  When you propose the offer, be prepared to supply answers to many, many specific questions.  Not being a professional programmer, I can't imagine all the data that would be required, but some do come to mind. For instance:
  1. What is the difference between an 'individual' and 'large family'.  What happens to those in between, say two or three people.
  2. How is the product delivered?  Is it pre-boxed, if so are they the same size and the individual gets 1 box and large family gets 5 boxes?
  3. What products are included in the dispensing, i.e. Dairy, Meat, Baked Goods, Beverage, etc.?
  4. Are the products consistent or subject to frequent changes?
You also say you would like to share the software with other offices.  Are they currently networked?  If not, perhaps you should consider a 'cloud' based solution.

I wish you the best of luck in your endeavor and thank you for the service you provide.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#6
(Apr-06-2017, 12:55 PM)sparkz_alot Wrote:
(Apr-06-2017, 03:13 AM)teenspirit Wrote: Unfortunately i live in an area basically devoid of programmers, rural mid missouri, hence me asking for help here. Im in the united states.
But this is the 21st century and we live and breath the internets :-) . I think your post would probably be better suited for the "Jobs" section of the forum. Before you go about re-inventing the wheel, it might pay (not in money, but time) to see what already exists...for free. What you describe seems to point to some form of inventory control. This article might prove of interest:
So there is a place i can go to get help with a fairly large project? i have written a few functions and i am happy with their performance, but my UI skills are not up to par for the mostly older people who will use the program. The difference between inventory and what i need to do is that what i need to do needs to speculate and adjust based on a complex and changing number, the number of people total vs. the number of 1 or 2 cards. I am going to make and use a program that will give me a few datasets to work with and experiment on, they may even have a few already recorded that i can borrow.
Reply
#7
I would say, sure, ask away  Smile.  As a charity, you have certain advantages.  If there is a college or university (or even a high school) near you with a computer science department, approach them with your request.  They may agree to have their students do it for extra credit towards their grade.  If there are similar charity's, see what software they use.  Even check Red Cross and FEMA.  I read some where on the forum (or perhaps it was the old one) where the US government was open sourcing  a lot of their software and can be found here: US Gov Code.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#8
I have made some progress towards what i want to do, not worked on it extensively yet though. I have a way to gather the data sets i need to make a better predictive program now, just need to get some of the written data from the last couple of giveaways, or take a new set of data at the new giveaway. the code I have so far is as follows:
#for use in the total() function
from fractions import Fraction

#gives the user their first instruction when they open the program
print("Press 'q' to quit the program and get a final total.")

#just a repepitive line
def lorsvalues():
    print ('Large families: ', large, ' small families: ', small)

#this function defines the first input data and how to store that data
def oneortwo():
    #declareing the necessary variables, large and small are global as they will be needed outside this function
    global large
    global small
    large = 0
    small = 0
    letter = ''
#while letter does not equal q runs this function until the user stops it
    while letter != 'q':
#We need to know whether to give more or less amount of food to each family, using 1 or 2 cards
        letter = input("Is it a large family or small? Type l for large family, s for small: ")
        if letter == 's':
            small = small + 1
            lorsvalues()
        elif letter == 'l':
            large = large + 1
            lorsvalues()
        else:
            print('......An incorrect or blank character has been entered, try the last entry again.')

#this function gives a tally with information when the program is exited. I intend to make this also write to a file for better predictions in the future.
def total():
    final_total = large + small
    print('***There is a final total of ',final_total, ' families***')
    lorsvalues()
    print('the ratio of large families to small families is: ' ,Fraction(large, small), ' large/small')
    
#simpoly calling the funtions we defined earlier
oneortwo()
total()
If any of you have suggestions or inputs on how to make this code neater, more intuitive, or better suited to the needs, please tell me. I looked pretty extensively beforehand and I could not find anything in the area of what is needed here. We give food to 1 or two cards, not necessarily single or family, but few people or more. We would give, say 6 ears of corn to the small family, 8 to the large, or 2 boxes of popcorn to the small, 3 to the large. The issue is that, right now, the ratio of 1's to 2's is guesswork, about how fast to give out the products, how many to 1's or 2's, was guesswork, no one even got out a calculator. The shipments are all marked with an exact amount.
Reply
#9
Some changes:
#for use in the total() function
from fractions import Fraction
 
#gives the user their first instruction when they open the program
 
#just a repepitive line
def show_sizes(large, small):
    print ('Large families: ', large, ' small families: ', small)
 
#this function defines the first input data and how to store that data
def one_or_two():
    # instruction for quitting
    print("Press 'q' to quit the program and get a final total.")
    #declareing the necessary variables
    large = 0
    small = 0
    while True:
        letter = input("Is it a large family or small? Type l for large family, s for small: ").lower()
        if letter in ('s', 'small'):
            small = small + 1
            show_sizes(large, small)
        elif letter in ('l', 'large'):
            large = large + 1
            show_sizes(large, small)
        elif letter in ('q', 'quit'):
            break
        else:
            print('......An incorrect or blank character has been entered, try the last entry again.')
        print()
    return large, small
 
#this function gives a tally with information when the program is exited. I intend to make this also write to a file for better predictions in the future.
def total(large, small):
    final_total = large + small
    print('\n***There is a final total of ',final_total, ' families***')
    show_sizes(large, small)
    print('The ratio of large families to small families is: ' ,Fraction(large, small), ' large/small')
    print('{:.1%} of the families were large.'.format(large / final_total))
     
#simpoly calling the funtions we defined earlier
large, small = one_or_two()
total(large, small)
I got rid of your globals in favor of using parameters and return values. I changed some of the names to be clearer. I added some blank lines to make the output clearer. I added a percentage to the final output, I think that's more intuitive. Note the use of the format method in that line. I find that makes it easier to change the text of the output later.

If this program is just for data collection, I would not use it. As a statistician who is into quantified self I have learned data collection needs to be as simple and easy as possible. There are easier ways to collect data than a computer keyboard. Keep the cards and count them afterwards would be easiest. If you can't do that, two boxes with chits you toss in would work well. Or buy two tally counters, they're cheap on Amazon.

If this program is going to be expanded an used as part of the predictive analysis, so you are using real time ticket counts to adjust what you are giving out as you give it out, then using the keyboard isn't so bad. You still might think about simpler ways to enter the data. If the predictive analysis is only adjusted every 20 families, it might be easier to enter the data only 20 families.

If you want to get programmers to help you, you need to describe the problem in much greater detail. I don't really have a good enough idea of what your operation is like to give good feedback on what you should be doing. And if you want to expand this to other charities, you are going to need to know how they are doing things differently.

And don't be surprised if there is push back. Some of the people who volunteer don't want things to be efficient.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#10
For study, Here are some software similar to what you want to write
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Optimization problem ( food menu ) Truman 3 3,561 Apr-01-2019, 09:28 PM
Last Post: Truman
  Packaging and Distributing App for Python 3.6 solaikannan 1 2,655 Aug-21-2017, 09:36 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020