mijnahlib package¶
Submodules¶
mijnahlib.mijnahlib module¶
Main module file
Put your classes here
-
class
mijnahlib.mijnahlib.
Item
(ah_instance, info)[source]¶ Bases:
object
Generic class of the products objects
Handles all the common parts
-
quantity
¶ The quantity of the items in the shopping cart
Returns: The quantity of the items
-
url
¶ The url of the item
Returns: The url of the item
-
-
class
mijnahlib.mijnahlib.
ItemFactory
[source]¶ Bases:
object
A factory that instantiates the appropriate object based on type
-
class
mijnahlib.mijnahlib.
Product
(ah_instance, info)[source]¶ Bases:
mijnahlib.mijnahlib.Item
An object to model the products.
-
brand
¶ The brand of the product
-
category
¶ The category of the product
-
description
¶ The description of the object
-
has_discount
¶ Whether the object is a discounted one
-
id
¶ The internal id of the item
-
is_orderable
¶ Whether the object is orderable on not
Returns: A boolean of the state
-
measurement_unit
¶ The measurement unit of the product according to AH
-
price
¶ The price of the product
-
price_previously
¶ The previous price of the product if on discount.
-
-
class
mijnahlib.mijnahlib.
Server
(username, password)[source]¶ Bases:
object
Object modeling the server connection.
Handles the authentication and exposes all the internal parts as attributes.
-
stores
¶
-
-
class
mijnahlib.mijnahlib.
ShoppingCart
(ah_instance)[source]¶ Bases:
object
Object modeling the shopping cart.
It is able to add items to the cart, by id or description. It exposes item objects through the content attribute
-
add_item_by_description
(description, quantity=1)[source]¶ Adds items to the shopping cart by the internal id representation
Parameters: - description – The description of the item
- quantity – The quantity as an integer
Returns: True on success False otherwise.
-
add_item_by_id
(item_id, quantity=1)[source]¶ Adds items to the shopping cart by the internal id representation
Parameters: - item_id – The internal representation of the item
- quantity – The quantity as an integer
Returns: True on success False otherwise.
-
contents
¶ The contents of the shopping cart
Returns: A list of items according to their type
-
-
class
mijnahlib.mijnahlib.
Store
(info)[source]¶ Bases:
object
-
address
¶
-
city
¶
-
id
¶
-
latitude
¶
-
longtitude
¶
-
opening_times_today
¶
-
opens_evenings
¶
-
opens_sunday
¶
-
street
¶
-
street_number
¶
-
telephone
¶
-
zip_code
¶
-
-
class
mijnahlib.mijnahlib.
UnspecifiedProduct
(ah_instance, info)[source]¶ Bases:
mijnahlib.mijnahlib.Item
An object to model the unspecified products
-
description
¶ The description of the product
-