rattail.vendors.catalogs
¶
Vendor Catalogs
- class rattail.vendors.catalogs.CatalogParser(config=None, **kwargs)[source]¶
Base class for all vendor catalog parsers.
Note
As of this writing the
config
param is technically optional for the class constructor method, but that will certainly change some day. Please be sure to pass aconfig
param when instantiating parsers in your code.- vendor_key¶
Key for the vendor. This key will be used to locate an entry in the settings table, e.g.
'rattail.vendor.unfi'
for a key of'unfi'
. The value of this setting must be an exact match to either arattail.db.model.Vendor.uuid
orrattail.db.model.Vendor.id
within the system. However this value may also beNone
(the default), in which case the user must ultimately specify which vendor should be used for the data import.
- property key¶
Key for the parser. Must be unique among all catalog parsers.
- make_row()[source]¶
Create and return a new row, suitable for use in a vendor catalog batch. The row will be empty and not yet part of any database session.
- Returns:
A
VendorCatalogBatchRow
instance.
- exception rattail.vendors.catalogs.CatalogParserNotFound(key)[source]¶
Exception raised when a vendor catalog parser is required, but cannot be located.
- rattail.vendors.catalogs.get_catalog_parser(key)[source]¶
Fetch a vendor catalog parser by key. If the parser class can be located, this will return an instance thereof; otherwise returns
None
.
- rattail.vendors.catalogs.get_catalog_parsers()[source]¶
Returns a dictionary of installed vendor catalog parser classes.