/inventory

A simple inventory system

Primary LanguagePython

Description

This is a simple, Python-based inventory system that incorporates a MicroLogix PLC, a pure Python inventory database, and a Flask webapp. The webapp is used to view, pick, and place inventory items. The Controller backend leverages pycomm to interface the PLC and perform the necessary functions.

Installation

Configure a Python 2.7 environment

Virtual environments are recommended. virtualenvwrapper is recommended.

pycomm isn’t currently Python 3 compatible. Use virtualenvwrapper to create a compatible virtual environment named “inventory” with the following command:

mkvirtualenv --python=python2.7 inventory

After the venv is created, virtualenvwrapper should activate it. Note the prompt change to confirm.

Clone this repository:

git clone --recurse-submodules https://github.com/ephsmith/inventory.git

Install package requirements

Assure that the venv is activated and issue the following commands to install package requirements:

cd inventory
pip install -r requirements.txt

Install project packages

Install pycomm

cd pycomm
pip install -e .
cd ..

Install remaining modules

Run this command in the top-level repository dir:

pip install -e .

Test installation

Run plc-test from the top-level directory with the inventory venv activated.

python plc-test.py

Test/Run Webapp

The current state of the webapp is for development purposes only. To run the webapp, assert that the venv is activated and issue the following commands from the top-level repo dir:

export FLASK_APP=webhouse.py
flask run

Then visit http://127.0.0.1:5000/ in a web browser.