Skip to content

This is a collections of scripts I have been writing to aid QA with investigating and logging issues flagged by the package sortation system.

Notifications You must be signed in to change notification settings

AlexKraken/warehousing-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About The Project

QA Website Screen Shot

These are scripts used to make QA's job a little easier. They started out as scripts to be used from the terminal and Python's interactive shell, but now include a website for those more comfortable with a web browser - demo (hosted freely on pythonanywhere.com and may need a minute to start up) located here: https://alexkraken.pythonanywhere.com/.

(back to top)

Getting Started

Prerequisites

You should already have Python installed, check by opening the terminal and running

python --version

Installation

  1. Clone the repo (or alternatively download as a .zip file) and change to the directory in the terminal

    git clone https://github.com/AlexKraken/warehousing-scripts.git
    cd warehousing-scripts
  2. To start the Barcode Logger

    python run_logger.py
  3. To use the weight checker (will need to be in a seperate terminal if you're already running the Barcode Logger)

    > python
    Python 3.11.3 
    >>>
    >>> from check_weight import check
    >>> check()

    To exit use

    >>> exit()
  4. To use the website (will also need to be in a seperate terminal and in the warehousing-scripts directory)

    1. Create a python virtual environment

      python -m venv venv
    2. Enable the virtual environment

      source venv/bin/activate
    3. Install all the required packages

      pip install --requirement qa-flask-website/requirements.txt
    4. Start the server for the Flask app

      python qa-flask-website/main.py
    5. In the terminal output there should be a line

      * Running on http://127.0.0.1:5000

      Enter http://127.0.0.1:5000 in a web browser to access the website (don't exit out of that terminal!)

    6. When finished, stop the server in the terminal by pressing CRTL + C, and deactivate the virtual environment by typing

      deactivate

(back to top)

Usage

Barcode Logger

This is useful for quickly checking whether or not a particular item has been logged before. Since any changes to a item's specifications won't be in effect until the next day, this log is useful for catching errors that have already been fixed but will still be flagged until the system updates.

Run from the terminal - when prompted, enter the name of an existing log file to import previously logged barcodes, or enter a name for a new file:

> python run_logger.py
Enter log file name: barcodes.csv
File not found, create a new file? [y/n]: y

The program will prompt with options:

Available commands [add/check/exit]: 

- - -

add:
    Use to add a new barcode to the log. Returns 'LOG SUCCESSFUL' if it was not
    previously entered, else returns 'ALREADY LOGGED'.

check:
    Use to check if a barcode has already been logged. Returns 'BARCODE FOUND'
    if it was previously entered, else returns 'NOT FOUND'. This will continue
    prompting for another barcode until the user enters 'exit'.

exit:
    Use to exit the program and return to the command line.

Weight Checker

This allows for quickly checking how far off the system's entry on an item's weight is from the actual amount.

For now, this script is meant to be used from Python's interactive shell to complement the other calculations that are commonly used:

> python
Python 3.11.3 
>>>
>>> from check_weight import check
>>> check()
Example:

Suppose an item's weight is measured to be 0.1 lbs, and the system has the weight as 1 lb. While in Python's interactive shell, run:

>>> check()
Enter the expected weight (in lbs): 1
Enter the measured weight (in lbs): 0.1
-----
Absolute error:   0.90 lbs
Percentage error: 900%

The Math

For fixing incorrect weights in the system, percentage error is defined as:

$$\text{Percentage Error} = \frac{{\text{Expected Weight} - \text{Measured Weight}}}{{\text{Measured Weight}}} \times 100\%$$
Example:

Suppose an item's weight is measured to be 0.25 lbs but the system expects the item's weight to be 1.50 lbs.

$$\text{Percentage Error} = \frac{{1.50 - 0.25}}{{0.25}} \times 100\% = 500\%$$

A 500% error means the system's expectation is 5 times OVER the actual weight, suggesting that the previous measurement could have been made on a case pack of 6 units, or the current item was mistakenly taken out of a case pack.

Example:

Suppose a case pack of 10 items is measured to be 1.20 lbs but the system expects the case pack to weigh 0.12 lbs.

$$\text{Percentage Error} = \frac{{0.12 - 1.20}}{{0.12}} \times 100\% = -900\%$$

A -900% error means the system's expectation is 9 times UNDER the measured weight, which suggests that either the case pack isn't how the item should be sold, or that the previous measurement was made by mistakenly taking an item out of its case pack.

(back to top)

Roadmap

For the website version:

  • Add ability to download barcode log as a .cvs file
  • Add color highlighting to messages
  • Add alternating colors to barcode log
  • Add ability to populate 'Barcode Logger' with info from 'Weight Checker'

See the open issues for a full list of proposed features (and known issues).

(back to top)

Acknowledgments

Built With

  • Flask
  • Bootstrap

Other helpful resources!

(back to top)

About

This is a collections of scripts I have been writing to aid QA with investigating and logging issues flagged by the package sortation system.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published