Name | abdur-shopping-cart JSON |
Version |
0.1.0
JSON |
| download |
home_page | |
Summary | |
upload_time | 2024-01-18 14:26:00 |
maintainer | |
docs_url | None |
author | Your Name |
requires_python | >=3.10,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Simple Shopping Cart
This is a simple shopping cart that allows you to add items into the cart
and display the state of the cart.
## Installation
To install the library run the below command in your virtual environment
`pip install abdur-shopping-cart`
## Code style
This project makes use of black with default settings to format the code
and flake 8 as a linter.
## Usage
`
from abdur_shopping_cart.shopping_cart import ShoppingCart
cart = ShoppingCart()
print(cart.add_to_cart("cornflakes", 1))
print(cart.add_to_cart("cornflakes", 1))
print(cart.add_to_cart("weetabix", 1))
print(cart.calculate_state())
`
![Alt text](image.png)
## API
`add_to_cart(product_name, quantity)`
Takes in a product name as a string, quantity as an integer
Returns a success/failure
`calculate_state()`
Calculates the current state of the cart
Returns the product names, quantities, sub_total, tax and total
# Testing
The project uses pytest to run its tests
# Other
The .gitignore file was generated using gitignore.io
https://www.toptal.com/developers/gitignore/
Raw data
{
"_id": null,
"home_page": "",
"name": "abdur-shopping-cart",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/d0/63/5cd833dbba188db5c0f59ce7aea935a45c5b4a4a3cc77705d2e6b4f81d99/abdur_shopping_cart-0.1.0.tar.gz",
"platform": null,
"description": "# Simple Shopping Cart\nThis is a simple shopping cart that allows you to add items into the cart\nand display the state of the cart.\n\n## Installation\n\nTo install the library run the below command in your virtual environment\n\n`pip install abdur-shopping-cart`\n\n## Code style\nThis project makes use of black with default settings to format the code\nand flake 8 as a linter.\n\n## Usage\n\n`\nfrom abdur_shopping_cart.shopping_cart import ShoppingCart\n\ncart = ShoppingCart()\nprint(cart.add_to_cart(\"cornflakes\", 1))\nprint(cart.add_to_cart(\"cornflakes\", 1))\nprint(cart.add_to_cart(\"weetabix\", 1))\nprint(cart.calculate_state())\n`\n\n![Alt text](image.png)\n\n## API\n\n`add_to_cart(product_name, quantity)`\nTakes in a product name as a string, quantity as an integer\nReturns a success/failure\n\n`calculate_state()`\nCalculates the current state of the cart\nReturns the product names, quantities, sub_total, tax and total\n\n# Testing\n\nThe project uses pytest to run its tests\n\n# Other\nThe .gitignore file was generated using gitignore.io\nhttps://www.toptal.com/developers/gitignore/",
"bugtrack_url": null,
"license": "",
"summary": "",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82ec7553130eb98b3d763c6dc21265dac817531ae7a08433a73d26a08125c887",
"md5": "4e692af5ecb9efb93a2f29a456c11384",
"sha256": "22cfc98cf5b2921a5925ba3727e11d19f514c806d1fcf124df6e1bb9ad4e2e37"
},
"downloads": -1,
"filename": "abdur_shopping_cart-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4e692af5ecb9efb93a2f29a456c11384",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 2685,
"upload_time": "2024-01-18T14:25:58",
"upload_time_iso_8601": "2024-01-18T14:25:58.839233Z",
"url": "https://files.pythonhosted.org/packages/82/ec/7553130eb98b3d763c6dc21265dac817531ae7a08433a73d26a08125c887/abdur_shopping_cart-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d0635cd833dbba188db5c0f59ce7aea935a45c5b4a4a3cc77705d2e6b4f81d99",
"md5": "e74876f1d389d89f9a7e84c21104e74a",
"sha256": "e04c089f9f9aca2fc5131776a968740a180ad11857c28ca4c062b1243faa1f53"
},
"downloads": -1,
"filename": "abdur_shopping_cart-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "e74876f1d389d89f9a7e84c21104e74a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 2116,
"upload_time": "2024-01-18T14:26:00",
"upload_time_iso_8601": "2024-01-18T14:26:00.789779Z",
"url": "https://files.pythonhosted.org/packages/d0/63/5cd833dbba188db5c0f59ce7aea935a45c5b4a4a3cc77705d2e6b4f81d99/abdur_shopping_cart-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-18 14:26:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "abdur-shopping-cart"
}