Giter Club home page Giter Club logo

bono-94-python-project-3-code-institute_janresub's Introduction

Life tracker is a Phyton-based terminal program that runs in the Code Institute mock terminal deployed on Heroku.

Users can run this daily tracker and analyzer in order to capture and process their daily activities.

Users input their events per each hour of the day inside the terminal that automatically updates the external Google Sheet and analyzes data.

Multi-devices Views


How it works?

  • Life tracker is created to be the starting point in the ultimate processing of all aspects of life
  • In this version user is presented first with an introduction, instructions, and rules
  • User is requested to enter their personal information (username + ID number)
  • Each time that program starts, it clears previous values in Google Sheet
  • The program requests user to enter their daily events in the format of subcategories and custom tasks
  • All inputs are exported to the tracking sheet
  • Total time consumption per subcategories and tasks are presented in the analyzer worksheet
  • It is where the user can see a visual representation of time consumption
  • Users can save or share their results and start the program again

Flowchart

Flowchart


Features

Existing Features

Options

  • First sheet that visually shows user examples that they can use for their custom tasks

Tracker

  • Second sheet where users' input get uploaded as per example in the row [2]

Analyzer

  • Third sheet where all calculated users' subcategories results of time consumption get uploaded

Analyzer Tasks

  • Third sheet where all calculated users' tasks results of time consumption get uploaded

Intro

  • Introduction to the program with the current date and time
  • General steps of how the program works are disclosed to users
  • Includes a link to external Google Sheet where user can track results

rules

  • General rules that should be respected in the program are disclosed to users

ID

  • Users are informed on what is needed for personal identification and what are the rules for inputting them
  • When message "Starting the program..." is printed, all previously inputted date in Google Sheet gets deleted

Subcategory

  • Main inputting function segment where the user is given the relevant time frame of a past event
  • It repeats 24 times as for 24 hours in user's day
  • Function displays numerical options for the user's convenience not having to constantly look at the options sheet or constantly retype options

Subcategory Input

  • When sub-category input satisfies criteria being identical to the options, the code returns confirmation of success

Tasks

  • Additional input function that captures custom task from user and expands general subcategory input to unique daily event
  • It repeats 24 times as for 24 hours in user's day
  • User can input anything meaningful or detailed as they wish

Input Track

  • User is presented with results for their previous 2 inputs for specific hour of a day
  • Each number chosen by relevant subcategory gets converted to actual belonging Subcategory label
  • As each function per hour of the day is processed, this is when it uploads the values to the Google Sheet tracker
  • Once the last sub-category and tasks are inputted, the program does not continue running the same input functions again but sends the user to the next outro section of program

Inputs Completed

  • Informative break from longer periods of input
  • When all values are inside of the tracker sheet, a user is informed that the whole process of updating tracker has occurred without an issue

Outro

  • After completing all the inputs and receiving reports, the user is presented with an outro message
  • First, there is a time and date for each program completion
  • Also user is reminded of the Google Sheets link in case they have not opened them yet to check the results
  • After farewell with the user, the program informs the user how to start it again upon finishing the exiting sequence
  • Inputting letter 'x' starts exiting sequence

Exit

  • The countdown from 10 seconds to 0 seconds starts

Exit Two

  • Countdown variable has inside 1 second waiting time so it creates the effect of and actual countdown
  • Once the countdown reaches 0, the user receives a message that the program is exiting and raises system exit task

Tracker Results Analyzer Results

  • Once user has all inputs sent to the tracking worksheet, analyzer worksheet additionally reports consumption with graphic support

Zapier

  • After every upload of inputs or results to any sheet updates, Zapier sends and email alert of new input on the Google Sheets

Upcoming Features

  • Allow users to choose a 12-hour or 24-hour format
  • Use regex patterns so the user cannot enter the username that contains any digits next to letters
  • Use regex patterns so the user cannot enter an ID number that contains any letters next to digits
  • Prevent user from entering any blank spaces for username and ID number
  • Remove double values from the tasks analyzer and replace empty fields with sub-tasks
  • Create a Microsoft Word document where user can carry out their to-do list that automatically
  • Expand the list of categories, sub-categories, tasks, and sub-tasks
  • Create a rewarding system
  • Create a unique sheet for every user so the public cannot access private information
  • Add voice-controlled inputs

Data Structure Model

Version 1

  • Due to the code total length of approximately 5000 lines, it needed to be fractioned and spread across 7 Python files.
  • Those files are all imported to the main file run.py
  • Once they were imported all functions including "running functions" were synchronized so the code can run.
  • Templates for all sub-category and tasks inputs segments have been expanded across other repetitive functions per hours
  • All variables have been placed inside the functions with docstrings describing the purpose
  • Each function has only a few main variables and some have a lot of small amount of print statements
  • All functions were organized to flow in logical order and priority of usage
  • Since all functions above line 1000 were placed in their belonging new Python files, all of the functions that assist in calling up function were also moved with them
  • Only at the main run.py all of their "calling" pr "running functions" were introduced to and organized at the bottom of the code ensuring that the code actually runs
  • Each function has been made under 80 characters horizontally and 24 rows vertically

Version 2

  • Major adjustments in the data structure model for Version 2 have been implemented
  • Instead of extremely long project counting 5000+ lines of code, DRY method has been implemented to the fullest
  • Creating advanced looping function allowed the total code to be reduced to under 600 lines
  • Instead of repetitive functions for each of 24 hours per day, one architecural adjustment has converted those repetitive functions to a template that gets run for each 24 hours of a day
  • Not only this reduces the gspread requests limit per minute but makes code much easier to read and evaluate
  • When there is a change or addition it is easier to adjust one template function instead of doing it 24 times for each hour of a day
  • This also reduces pressure on hardware and increases overall productivity and smooth user interaction

Testing

Manual Testing

This project was manually tested with following procedures:

  • Code was passed through a PEP8 linter inside gitpod without any errors returned
  • Program was tested with correct and incorrect inputs in the both gitpod and Heroku terminals

Test Intro

  • If the user inputs ANYTHING besides the letter "x" and presses enter, it will show an error
  • This applies to using any other letter besides "x", for example: "y"
  • This applies to using any numbers istead of "x"
  • This applies for using more than 1 letter "x" for example: "xxx" or "x"
  • Testing only passes for single input: "x" and nothing else
  • Test SUCCESSFUL!

Test rules

  • If the user inputs ANYTHING besides the letter "x" and presses enter, it will show an error
  • This applies to using any other letter besides "x", for example: "z"
  • This applies to using any numbers istead of "x"
  • This applies for using more than 1 letter "x" for example: "xxx" or "x"
  • Testing only passes for single input: "x" and nothing else
  • Test SUCCESSFUL!

Test Username

  • Inputting username, the program does not allow numbers as value
  • It also successfully rejects empty inputs
  • Username is successfully programmed to not alow user to enter more than 50 characters
  • After correct input, the program successfully returns lowercase names to first letter capitalized
  • Test SUCCESSFUL!

Test ID

  • Inputting ID number, the program does not allow letters only as the value as intended
  • Program successfully rejects empty inputs
  • Starting the program line clears all values from the Google sheet as intended
  • Test SUCCESSFUL!

Test Subcategory Input

  • Sub-categories input successfully does not allow empty fields or letters as inputs
  • Only identical value to numbers 1-12 without punctuation or "1)" are allowed as the valid input
  • Test SUCCESSFUL!

Test Task Input

  • Tasks input successfully does not allow empty fields or numerical values
  • It also does not allow as intended inputs over 50 characters and under 3 letters
  • Test SUCCESSFUL!

Test Inputs

  • If the user inputs ANYTHING besides the letter "x" and presses enter, it will show an error
  • This applies to using any other letter besides "x", for example: "y"
  • This applies to using any numbers istead of "x"
  • This applies for using more than 1 letter "x" for example: "xxx" or "x"
  • Testing only passes for single input: "x" and nothing else
  • Test SUCCESSFUL!

Test Subcategory Hour

  • For every looped main function that repeats 24 times for each hour, it correctly increases the relevant hour every time it runs a new loop as intended
  • Test SUCCESSFUL!

Test Subcategory Results

  • For every looped main function that repeats 24 times for each hour, it correctly increases the relevant hour every time it runs a new loop as intended
  • It converts user's numerical choice to the relevant label for easier understanding for example choice "8) Business Progress". User inputs number 8 but when reported results back it converts user's input to: "Business Progress" as intended
  • Test SUCCESSFUL!

Test Completed

  • If the user inputs ANYTHING besides the letter "x" and presses enter, it will show an error
  • This applies to using any other letter besides "x", for example: "y"
  • This applies to using any numbers istead of "x"
  • This applies for using more than 1 letter "x" for example: "xxx" or "x"
  • Testing only passes for single input: "x" and nothing else
  • Test SUCCESSFUL!

Test Outro

  • If the user inputs ANYTHING besides the letter "x" and presses enter, it will show an error
  • This applies to using any other letter besides "x", for example: "w"
  • This applies to using any numbers istead of "x"
  • This applies for using more than 1 letter "x" for example: "xxx" or "x"
  • Testing only passes for single input: "x" and nothing else
  • Test SUCCESSFUL!

Test Exit

  • Exitting sequence correctly runs countdown loop from 10 seconds to 0
  • Each countdown row correctly occurs for 1 second as intended and coded
  • System Exit sequence correctly exits the program
  • Test SUCCESSFUL!

Bugs

Solved Bugs

Long Line

  • All lines longer than 79 characters have been reduced by adjusting vocabulary and making content as concise as possible

Max Read

  • Terminal cannot read more than 60 read variables per minute, causing code to crash half-way through reporting tasks time consumption

Max Read

  • Function was created half-way through tasks reporting to give 60 seconds break in order to execute the all funtions without causing problems with maximum readability per month

Max Read

  • Finished runned code of introducting break of 1 minute at the half of tasks reports provided to the user

Unsolved Bugs

  • All bugs were solved

Validator Testing

PEP8

Validator


Deployment

This project was deployed using Code Institute's mock terminal for Heroku website.

Deployment steps:

  • Update requierements.txt
  • Create or login to Heroku account
  • Activate Student GitHub Pack
  • Update billing information
  • Create new app/website
    • add name and region
  • Access settings
  • Create Config Var
    • input “CREDS” into the “KEY” field
    • copy creds.json file contents and paste into “VALUE” field
    • add “PORT” to “KEY” and “8000” to “VALUE”
  • Add Buildpack
    • add python to the top of the list
    • add nodejs to the bottom of the list
  • Go to deployment section
    • select github and connect to the relevant account
    • search for relevant repository and connect
    • choose manual deployment option
    • everything gets installed
    • link is provided when finished
  • Subscribe to ecodynos plan under the billing options
  • Create README file
  • Push changes
  • Quick Redeployment

Credits

Content, Knowledge and Code

  • All content and code are 100% unique and custom-made per request for a client in order to prevent any legal issues in the future and to provide full control over an optimized experience

  • All content, concepts, and visuals have been exclusively created for this site and to solve specific problem for any user without any external inspiration

  • Code structure is also 100% original and completely created by a developer. A developer has followed HTML, CSS, JavaScript and Python courses at Code Institute where theory on building blocks has been taught. After reading through knowledge materials to see what are possibilities of creating this site are, general blocks have been put together separately to create original work. Given completed examples have not been plagiarized but served as a general guide from a client for a developer from project examles such as: love-sandwiches and battleships. Finally, the README structure has been used by Code Institute's template and example in this project in order to be created under industry standards and expectations. A general python template for repository created for students before commencing their project for convenience has been imported before the first coding lines. Project requirements have been used as secondary rough guidelines for the content structure. Consultations with Student Care, Tutors, and Personal Mentor Rowan were provided by them as well which was crucial in this project creation by providing support, motivation, and any mistakes indications and guidance to own problem-solving

  • All debugging and problem-solving has been done strictly by the developer trying different combinations with known and unknown elements and attributes. No external sources and no professional help just Code Institute's tutors for elaboration on theory and advices dealing with complex problems

  • Code Institute Python Template

Code References:

  • Free Code Camp - how to import date-time elements

      from datetime import datetime
    
      current_dateTime = datetime.now()
    
      print(current_dateTime)
      # 2022-09-20 10:27:21.240752
    
  • USED HERE: Date-Time Usage


  • Real Python - how to import external libraries

      import mod
    
  • USED HERE: Import Usage


  • Real Python - how to include 1 second delay to countdown function

      >>> import time
      >>> time.sleep(3) # Sleep for 3 seconds
    
  • USED HERE: Time Sleep Usage


  • gspread - how to upload user's inputs to external Google Sheet

      worksheet.update('B1', 'Bingo!')
    
  • USED HERE: Uploader Usage


  • W3B Schools - how to create looped funtion that occurs 24 times for each hour of a day

      for x in range(2, 6):
        print(x)
    
  • USED HERE: Range Usage


Media

  • Am I Responsive? - The photo from the website was used in this README file to demonstrate responsiveness

Tools

  • Grammarly - software has been used to verify grammar on the site and this README file

  • Zapier - online automation website that is used to send emails every time new user enters a new imput

  • Draw.io - online website that was used to create Flowchart for README


Thank you for READING ME!

bono-94-python-project-3-code-institute_janresub's People

Contributors

bono-94 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.