rattail.vendors.orders

Vendor Order Files

class rattail.vendors.orders.DefaultOrderParser(config)[source]

Default order parser for Excel files.

key = 'default'
title = 'Default Excel Parser'
class rattail.vendors.orders.ExcelOrderParser(config)[source]

Base class for Excel vendor order parsers.

decimal(value, scale=2)[source]

Convert a value to a decimal.

get_excel_reader(path)[source]

Return an ExcelReaderXLSX instance for the given path.

get_excel_reader_kwargs(**kwargs)[source]

Should return kwargs for the Excel reader factory.

class rattail.vendors.orders.OrderParser(config)[source]

Base class for all vendor order parsers.

get_vendor(session)[source]

Fetch the Vendor record which is associated with the current parser, if any.

property key

Key for the parser. Must be unique among all order parsers.

make_order_item(**kwargs)[source]

Make and return a PurchaseItem instance.

parse_order_date(path)[source]

Parse the order date from the order file.

parse_order_items(path, progress=None)[source]

Parse all data items (rows) from the order file.

parse_order_number(path)[source]

Parse the order number from the order file.

property title

Human-friendly title for the parser.

exception rattail.vendors.orders.OrderParserNotFound(key)[source]

Exception raised when an order file parser is required, but cannot be located.