Inventory Manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
BBaoVanC 37ffa1d346
Reformat code
9 months ago
templates/ui Reformat code 9 months ago
.gitignore Add Visual Studio Code to .gitignore 10 months ago
.pylintrc Update all routes to use SQLAlchemy 10 months ago
LICENSE Initial commit 10 months ago
README.md Write README.md 10 months ago
libdb.py Finish API 10 months ago
postgres.ini.default Add postgres.ini.default 10 months ago
requirements.txt Begin rewrite from psycopg2 to SQLAlchemy 10 months ago
webapi.py Reformat code 9 months ago
webui.py Add purchases and uses pages 10 months ago

README.md

InvMan

Table of Contents

  1. What is InvMan?
  2. API Usage
    1. GET Requests
    2. POST Requests

What is InvMan?

InvMan is a Flask app which provides a web API and web UI to keep inventory using a PostgreSQL backend.


API Usage

GET requests (getting information)


Please keep in mind:

  • Text surrounded by [ and ] are parameters which should be replaced.
  • Names are case-sensitive.

Get a list of locations

GET /api/v1/locations

Get information about a location

GET /api/v1/location/name/[location-name]

Get the quantities of all products at a location

GET /api/v1/location/[location-name]/quantities

Get the quantity of a product (by UPC) at a location

GET /api/v1/location/[location-name]/quantity/upc/[product-upc]

Get the quantity of a product (by name) at a location

GET /api/v1/location/[location-name]/quantity/name/[product-name]

Get a list of products

GET /api/v1/products

Get information about a product (by UPC)

GET /api/v1/product/upc/[product-upc]

Get information about a product (by name)

GET /api/v1/product/name/[product-name]

Get a list of brands

GET /api/v1/brands

Get information about a brand

GET /api/v1/brand/name/[brand-name]

Get a list of units

GET /api/v1/units

Get information about a unit (by name)

GET /api/v1/unit/name/[unit-name]

Get a list of purchases

GET /api/v1/purchases

Get information about a purchase (by id)

GET /api/v1/purchase/id/[purchase-id]

Get a list of uses

GET /api/v1/uses

Get information about a use (by id)

GET /api/v1/purchase/id/[use-id]

POST Requests (creating objects)


Create a location

POST /api/v1/create_location
Argument Name Description Required?
name Name of the location Yes
description Description of the location No

Request form:

Create a brand

POST /api/v1/create_brand
Argument Name Description Required?
name Name of the brand Yes
description Description of the brand No

Request form:

Create a unit

POST /api/v1/create_unit
Argument Name Description Required?
name Name of the unit Yes
description Description of the unit No

Request form:

Create a product

POST /api/v1/create_product
Argument Name Description Required?
upc UPC of the product Yes
brand Brand which makes the product Yes
name Name of the product Yes
size Size of the product Yes
sizeunit Unit used in size Yes
description Description of the product No

Request form:

Create a purchase

POST /api/v1/create_purchase
Argument Name Description Required?
upc UPC of the product which was purchased Yes
quantity Quantity of the product purchased Yes
date Date of this purchase Yes
location Location to link this purchase to Yes

Create a use

POST /api/v1/create_use
Argument Name Description Required?
upc UPC of the product which was used Yes
quantity Quantity of the product used Yes
date Date of this usage Yes
location Location to link this usage to Yes