Weighing Data System is a terminal application that allows the user to input the inweight of vehicles that coming into a site and input the outweights of vehicles leaving site. The system then calculates the netweight of each vehicle and the total load of vehicles that have been in and out of site for that period (this system is based on 5 vehicles per period weighing a minimum of 7,500kg). The data logged for inweight, outweight and netweight is then parsed to google sheets for record keeping and further analysis.
STRATEGY
Focus - What’s worth doing?
Creating an app that allows a user to input weight of vehicles arriving and leaving sites, automatically calculate netweight and total load then upload the data for record keeping and further analysis.
Definition - What are we creating?
A terminal application that allows the user to address a real-life need – inputting and analyzing data in the weighing industry.
Value - What value does it provide?
It allows a user to log known weights of vehicles arriving and leaving site and calculates netweights which can then be exported into a format that can then be fed into their own internal system.
SCOPE
What features will be available?
There will be two input requests for the user asking for 5 inweights as the vehicles are arriving onsite and 5 outweights as the vehicles are leaving site. The user will then be able to upload the data to google sheets and will be notified of total load.
STRUCTURE
How is the user interaction designed?
At the top of the terminal will be the title of the application Weighing Data System. The user will then be asked to input the 5 inweights which will give an error if the values entered aren’t integers, over required weight or in the correct format. The user will then be notified if the inweight data has been successfully uploaded to google sheets. Next, the user will be asked to input 5 outweights which will also give an error if the values entered aren’t integers, over required weight or in the correct format. The user will then be notified if the outweight data has been successfully uploaded to google sheets. The app will then calculate netweight from outweights minus inweights and notify the user when the netweight data has been successfully uploaded to google sheets. The app will then calculate total load by adding the 5 netweights then printing each of the outweights, inweights, netweights and finally total load.
SKELETON
How will the interface be laid out?
Command-line interface with step by step instructions for user to follow and notifications of outputs.
SURFACE
What will the visual design look like?
Heroku app with step by step instructions for user to follow and notifications of outputs.
FUTURE RELEASES
What features would you like to have in the future?
Allow the user to select how many vehicles they will have coming to and leaving site for the given period and select the minimum weight for the vehicle.
TECHNOLOGY
What technology was used?
- Gitpod - writing code on workspace.
- Github - hosting repository.
- Python - programming language used to write code.
- Google API - interface used to allow integration between google sheets and program.
- Heroku - platform used to deploy the app.
TESTING
How was the app tested and are there any bugs that have not been addressed?
Tested code PEP8 on https://www.pythonchecker.com/ with no major errors and a 96% mark. 6 minor issues are no whitespaces around operators. Also tested code by running pylint run.py on the terminal with the following results:
Reviewed app on Heroku dashboard and zero errors found as per below:
Tested app is working correctly by following the step by step instructions in order to spot errors or inconsistencies - none found as per below:
Tested possible common errors such as inputting a string instead of integer, not inputting 5 values and inputting values less than 7,500kg:
Bug was found upon opening workspace on different device after a previously successful test, commit and push. Error messages - Unable to import gspread and Unable to import google.oauth2.service_account.
Investigated on stack overflow and ran:
- pip install --upgrade google-auth google-auth-httplib2 google-api-python-client
- pip install gspread
- uploaded creds.json
Program tested fine afterwards though this bug kept happening upon opening workspace on different devices .
Program still requires the pip install gspread and creds.json upload upon opening workspace on new device.
DEPLOYMENT
How was the project deployed?
The project was deployed using Github, Gitpod and Heroku. The steps to deploy are as follows:
- Open Gitpod via Github repository
- Run python3 run.py to test program
- Link Heroku to Githib and create new app
- Add creds.json config
- Add python buildpack
- Add node.js buildpack
- Link Heroku app to repository
- Select Deploy
The live link can be found here https://weighing-data.herokuapp.com/
CREDITS
Code Institute - https://codeinstitute.net/
Stack Overflow - https://stackoverflow.com/