cosmel.repo.product module¶
-
class
cosmel.repo.product.Product(pid, brand, name, head, name_ws, descr_ws)[source]¶ Bases:
objectThe product object.
Parameters:
-
class
cosmel.repo.product.ProductSet(repo_root, bname_to_brand)[source]¶ Bases:
collections.abc.CollectionThe set of products.
- Item: the product object (
Product).
Parameters: - repo_root (str) – the path to the folder containing data files.
- bname_to_brand (
BName2Brand) – the dictionary maps brand name to brand object.
- Item: the product object (
-
class
cosmel.repo.product.Id2Product(product_set)[source]¶ Bases:
collections.abc.MappingThe dictionary maps ID to product.
- Key: the product ID. (str).
- Item: the product object (
Product).
Parameters: product_set ( ProductSet) – the product set.
-
class
cosmel.repo.product.BrandPName2Product(product_set)[source]¶ Bases:
collections.abc.MappingThe dictionary maps brand object and product name to product object.
Parameters: product_set ( ProductSet) – the product set.
-
class
cosmel.repo.product.BNamePName2Product(brand_pname_to_product, bname_to_brand)[source]¶ Bases:
collections.abc.SequenceThe dictionary maps brand name and product name to product.
- Key: the tuple of brand name (str) and product name (str).
- Item: the product object (
Product).
Parameters: - brand_pname_to_product (
BrandPName2Product) – the dictionary maps brand object and product name to product object. - bname_to_brand (
BName2Brand) – the dictionary maps name and brand.
-
class
cosmel.repo.product.PName2ProductList(product_set)[source]¶ Bases:
collections.abc.MappingThe dictionary maps product name to product object list.
- Key: the product name (str).
- Item:
ReadOnlyListof product object (Product).
Parameters: product_set ( ProductSet) – the product set.
-
class
cosmel.repo.product.BrandHead2ProductList(product_set)[source]¶ Bases:
collections.abc.MappingThe dictionary maps brand object and head word to product object list.
- Key: tuple of brand object (
Brand) and product head word (str). - Item:
ReadOnlyListof product object (Product).
Parameters: product_set ( ProductSet) – the product set.- Key: tuple of brand object (
-
class
cosmel.repo.product.BNameHead2ProductList(brand_head_to_product_list, bname_to_brand)[source]¶ Bases:
collections.abc.SequenceThe dictionary maps brand name and head word to product object list.
- Key: tuple of brand name (str) and product head word (str).
- Item:
ReadOnlyListof product object (Product).
Parameters: - brand_head_to_product_list (
BrandHead2Productlist) – the dictionary maps brand object and head word to product object list. - bname_to_brand (
BName2Brand) – the dictionary maps name and brand.