Skip to main content

A Shopping Python Framework

Project description

Micro Shop Framework

CircleCI

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shop_python-0.0.5.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

shop_python-0.0.5-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file shop_python-0.0.5.tar.gz.

File metadata

  • Download URL: shop_python-0.0.5.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for shop_python-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d2fcfe706ae10f2c55de3091296ac5f74920052ae3237cc5aa787577aab74d86
MD5 ba4bc80883768cc3fd89c1f46f145e6d
BLAKE2b-256 5a1d446ecdd4900b83ce04b6d2ae5924eae9876b364dc3731b551bac4bb93fb5

See more details on using hashes here.

File details

Details for the file shop_python-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: shop_python-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for shop_python-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9b4c7cece1f8c9cbe6fca525283206caf9d5ee0eb132a7a71d6e764010aa4e18
MD5 6a4793e80dfe9ef88ca066fe96f2475c
BLAKE2b-256 c7eecaf57eb46a91ff73168eaed151fdd3445bd914d77068105e6d64e8d12f25

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page