DW.get_products_stock (eng) - datawizio/pythonAPI GitHub Wiki
Parameters
-
categories: int, list
id of the category or a list of ids that will be used for selection. -
products: int, list
id of the product or a list of ids that will be used for selection. -
shops: int, list
id of the shop or a list of ids that will be used for selection. -
date_from: datetime, str {%Y-%m-%d}
starting date of selection. -
date_to: datetime, str {%Y-%m-%d}
ending date of selection.
If only date_to
has been set, then date_to
- 30 : date_to
will be used for selection.
If only date_from
, has been set, then date_from
: date_from
+ 30 will be used for selection.
If the interval [date_from, date_to]
has not been set, last 30 days will be used for selection.
by: str, list
{'stock_qty': Quantity of products on the balance,
'stock_value': self-cost products on the balance},
default: "stock_qty"
characteristics that will be used for receiving selection results.
show: str,
{"name": <product_name> for names of columns,
"id": <product_id> for names of columns,
"both": <product_id>_
<product_name> for names of columns,
default: "id" }
type of column name.
view_type: raw, represent
format of table representation.
Returns:
if view_type: raw
, than formed table:
date | product | stock_qty | ...N | |
1 | by | by | by | by |
2 | by | by | by | by |
...N | by | by | by | by |
if view_type: represent
, than formed table:
product1 | product2 | ...productN | |
date1 | by | by | by |
date2 | by | by | by |
... | |||
dateN | by | by | by |
Examples
dw = datawiz.DW()
dw.get_products_stock(categories = [68805, 69607], by='stock_value',
shops = [601, 641],
date_from = datetime.date(2015, 8, 9),
date_to = datetime.date(2015, 9, 9),
)
Returns data about cost of stock for categories with id [68805, 69607]
, from 9-8-2015
till 9-9-2015
for shops [601, 641]
.