sanmar_sdk.ftp.inventory

SanMar’s inventory files.

  • sanmar_dip.txt is refreshed hourly: one row per style, color, size and warehouse, with that warehouse’s stock (capped by SanMar) and the current piece, case and sale prices. SanMar recommends it over its inventory web services for anything more frequent than a live check at ordering time. sanmar_closeouts_dip.txt has the same layout.

  • sanmar_activeproductsexport.txt is the older per-warehouse export, with fewer columns and no sale prices.

Both are pipe-delimited, with a header row.

Discontinued products stay in the file with a quantity of 0 while any size of that color has at least 12 pieces left. SanMar suggests skipping rows whose discontinued_code is S and whose quantity is 0, and checking again later: returned stock can bring them back.

Attributes

WAREHOUSE_INVENTORY_COLUMNS

sanmar_dip.txt, as SanMar's server writes it.

ACTIVE_PRODUCTS_COLUMNS

sanmar_activeproductsexport.txt, as SanMar's server writes it.

Classes

WarehouseInventory

One style, color and size at one warehouse.

Functions

read_warehouse_inventory(...)

Stream sanmar_dip.txt (or sanmar_closeouts_dip.txt), one row at a time.

read_active_products(...)

Stream sanmar_activeproductsexport.txt, one row at a time.

Module Contents

sanmar_sdk.ftp.inventory.WAREHOUSE_INVENTORY_COLUMNS = ('inventory_key', 'size_index', 'catalog_no', 'catalog_color', 'size', 'whse_no', 'quantity',...[source]

sanmar_dip.txt, as SanMar’s server writes it.

The FTP Integration Guide v23.6 lists two more columns, SALE_START_DATE and SALE_END_DATE, that the file does not have; its sale dates are the _datetime ones.

sanmar_sdk.ftp.inventory.ACTIVE_PRODUCTS_COLUMNS = ('inventory_key', 'size_index', 'catalog_no', 'catalog_color', 'size', 'whse_no', 'quantity',...[source]

sanmar_activeproductsexport.txt, as SanMar’s server writes it.

The guide says it ends by repeating the inventory key; the file ends with the unique key.

class sanmar_sdk.ftp.inventory.WarehouseInventory(/, **data: Any)[source]

Bases: sanmar_sdk.base.Record

One style, color and size at one warehouse.

inventory_key: int[source]
size_index: int[source]
style: str = None[source]
catalog_color: str[source]

The catalog (mainframe) color, which web services and orders expect.

size: str[source]
warehouse: sanmar_sdk.common.WarehouseNumber = None[source]
quantity: int[source]

Stock at this warehouse, capped by SanMar.

unique_key: str | None = None[source]

SanMar’s identifier for this style, color and size, and the PromoStandards part id.

piece_weight: decimal.Decimal | None = None[source]
piece_price: sanmar_sdk.base.Price = None[source]
case_price: sanmar_sdk.base.Price = None[source]
case_size: int | None = None[source]
piece_sale_price: sanmar_sdk.base.Price = None[source]
case_sale_price: sanmar_sdk.base.Price = None[source]
sale_start_date: sanmar_sdk.base.SanMarDate | None = None[source]
sale_end_date: sanmar_sdk.base.SanMarDate | None = None[source]
discontinued_code: str | None = None[source]

Who discontinued the product, S for SanMar or M for the mill.

property discontinued: bool[source]

Whether SanMar or the mill has discontinued the product.

sanmar_sdk.ftp.inventory.read_warehouse_inventory(source: sanmar_sdk.ftp.readers.Source, *, encoding: str = 'utf-8-sig') → collections.abc.Iterator[WarehouseInventory][source]

Stream sanmar_dip.txt (or sanmar_closeouts_dip.txt), one row at a time.

sanmar_sdk.ftp.inventory.read_active_products(source: sanmar_sdk.ftp.readers.Source, *, encoding: str = 'utf-8-sig') → collections.abc.Iterator[WarehouseInventory][source]

Stream sanmar_activeproductsexport.txt, one row at a time.