sanmar_sdk.ftp.inventory ======================== .. py:module:: sanmar_sdk.ftp.inventory .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: sanmar_sdk.ftp.inventory.WAREHOUSE_INVENTORY_COLUMNS sanmar_sdk.ftp.inventory.ACTIVE_PRODUCTS_COLUMNS Classes ------- .. autoapisummary:: sanmar_sdk.ftp.inventory.WarehouseInventory Functions --------- .. autoapisummary:: sanmar_sdk.ftp.inventory.read_warehouse_inventory sanmar_sdk.ftp.inventory.read_active_products Module Contents --------------- .. py:data:: WAREHOUSE_INVENTORY_COLUMNS :value: ('inventory_key', 'size_index', 'catalog_no', 'catalog_color', 'size', 'whse_no', 'quantity',... ``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. .. py:data:: ACTIVE_PRODUCTS_COLUMNS :value: ('inventory_key', 'size_index', 'catalog_no', 'catalog_color', 'size', 'whse_no', 'quantity',... ``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. .. py:class:: WarehouseInventory(/, **data: Any) Bases: :py:obj:`sanmar_sdk.base.Record` One style, color and size at one warehouse. .. py:attribute:: inventory_key :type: int .. py:attribute:: size_index :type: int .. py:attribute:: style :type: str :value: None .. py:attribute:: catalog_color :type: str The catalog (mainframe) color, which web services and orders expect. .. py:attribute:: size :type: str .. py:attribute:: warehouse :type: sanmar_sdk.common.WarehouseNumber :value: None .. py:attribute:: quantity :type: int Stock at this warehouse, capped by SanMar. .. py:attribute:: unique_key :type: str | None :value: None SanMar's identifier for this style, color and size, and the PromoStandards part id. .. py:attribute:: piece_weight :type: decimal.Decimal | None :value: None .. py:attribute:: piece_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: case_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: case_size :type: int | None :value: None .. py:attribute:: piece_sale_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: case_sale_price :type: sanmar_sdk.base.Price :value: None .. py:attribute:: sale_start_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: sale_end_date :type: sanmar_sdk.base.SanMarDate | None :value: None .. py:attribute:: discontinued_code :type: str | None :value: None Who discontinued the product, ``S`` for SanMar or ``M`` for the mill. .. py:property:: discontinued :type: bool Whether SanMar or the mill has discontinued the product. .. py:function:: read_warehouse_inventory(source: sanmar_sdk.ftp.readers.Source, *, encoding: str = 'utf-8-sig') -> collections.abc.Iterator[WarehouseInventory] Stream ``sanmar_dip.txt`` (or ``sanmar_closeouts_dip.txt``), one row at a time. .. py:function:: read_active_products(source: sanmar_sdk.ftp.readers.Source, *, encoding: str = 'utf-8-sig') -> collections.abc.Iterator[WarehouseInventory] Stream ``sanmar_activeproductsexport.txt``, one row at a time.