inema.data module¶
- inema.data.formats¶
Default format list.
Initialized with the result of
load_formats().Example
>>> inema.data.formats[0] Out[2]: {'id': 1, 'isAddressPossible': True, 'isImagePossible': False, 'name': 'DIN A4 Normalpapier', 'description': None, 'pageType': 'REGULARPAGE', 'pageLayout': {'size': {'x': 210, 'y': 297}, 'orientation': 'PORTRAIT', 'labelSpacing': {'x': 0, 'y': 0}, 'labelCount': {'labelX': 2, 'labelY': 5}, 'margin': {'top': 31, 'bottom': 31, 'left': 15, 'right': 15}}}
- inema.data.load_formats()[source]¶
Load bundled format list.
- Returns:
List of format dictionaries.
- Return type:
list
- inema.data.load_products()[source]¶
Load bundled products dictionary.
Read the most recent inema/data/products-YYYY-MM-DD.json where YYYY-MM-DD is not more recent than today. Fall back to inema/data/products.json. This allows to ship multiple products.json files for announced future price/product changes.
- Returns:
Mapping of product code string to product information dictionary that provides cost_price and other fields.
- Return type:
dict
Warning
The cost_price field is in euro while all price amounts in the Internetmarke REST API are in euro cent.
- inema.data.products¶
Default product dictionary.
Initialized with the result of
load_products().Example
>>> inema.data.products['1'] {'cost_price': '0.95', 'international': False, 'max_weight': '20', 'name': 'Standardbrief'}