A Shopping Python Framework
Project description
Micro Shop Framework
Made in Python 3.
Welcome to the micro shopping framework, shop-python
.
Install it with pip:
python3 -m pip install shop-python --upgrade
You can then import the module.
This module consists of 4 other packages, namely:
- Product
- POS
- Customer
- Store
from shop_python import Product, POS, Customer, Store
Product
Product package class has the following attributes:
- uniqueId
- name
- price
- description
- quantity
uniqueId
is not autogenerated for each product. Developer will have to create one, including for all other attributes.
Example usage:
banana = Product(uniqueId="FRUITBANANA001", name="Yellow Sweet Banana", price=2.50, description="Sweet, yellow, ripe banana, air-flown from Australia", quantity=100)
POS
POS is the Point of Sale package that operates the cash register for the clerk/teller to manage customer transactions. Currently it only checks for balance amount and movement of the transactions.
Initiate the POS instance with a starting balance amount.
cashier_pos = POS(balance=100.0)
When performing a transaction for money coming into the cash register, use the money_in()
function.
cashier_pos.money_in(amount=24.99)
When performing a transaction for money coming out of the cash register, use the money_out()
function.
cashier_pos.money_out(amount=24.99)
To get the current balance of the POS, get its balance attribute.
cashier_pos.balance
Customer
// TODO
Store
A store is one shop. A shop has a name, a list of products and a POS associated with it (TODO: Turn it into a list of POS for multiple tellers/cashiers)
Initiate a store instance with a POS and a list of Products.
my_shop = Store(name="My Supermarket", pos=cashier_pos, products=[banana])
Display a list of products in the store:
my_shop.displayProducts()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for shop_python-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b4c7cece1f8c9cbe6fca525283206caf9d5ee0eb132a7a71d6e764010aa4e18 |
|
MD5 | 6a4793e80dfe9ef88ca066fe96f2475c |
|
BLAKE2b-256 | c7eecaf57eb46a91ff73168eaed151fdd3445bd914d77068105e6d64e8d12f25 |