sdk for getting product information
Project description
villaInventorySdk
read and write inventory in real time
Install
pip install villaInventorySdk
How to use
Uploading a large amount of data
sample input
input = [
{'ib_brcode': '1023',
'ib_cf_qty': '835',
'ib_prcode': '84621',
'new_ib_vs_stock_cv': '839'},
{'ib_brcode': '1022',
'ib_cf_qty': '24',
'ib_prcode': '12424',
'new_ib_vs_stock_cv': '21'}
]
Upload data
from villaInventorySdk.inventory import InventorySdk
from random import randrange
import boto3
from dataclasses import dataclass
from dataclasses_json import dataclass_json
from datetime import datetime
t0 = datetime.now()
print(f'uploading {len(input)} items')
sdk = InventorySdk(user=USER, pw=PW)
result = sdk.updateWithS3(
input,
inputBucketName= 'input-bucket-dev-manual',
functionName= 'update-inventory-s3-dev-manual',
invocationType = 'RequestResponse'
)
dt = datetime.now()-t0
print(f'it took {dt.seconds} s')
uploading 2 items
data was saved to s3
data is saved to s3, invoking ingestion function
input to lambda is {'inputBucketName': 'input-bucket-dev-manual', 'inputKeyName': 'input-data-name'}
it took 1 s
Query single product
import json
sdk = InventorySdk(user=USER, pw=PW)
result = sdk.querySingleProduct(ib_prcode = '84621')
json.loads(result)
{'statusCode': 200,
'inventory': '{"1023": {"ib_cf_qty": 835, "new_ib_bs_stock_cv": 839, "lastUpdate": 1601394614.340882}, "lastUpdate": 1601394614.340882, "ib_prcode": "84621"}'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
villaProductSdk-0.0.1.tar.gz
(12.4 kB
view hashes)
Built Distribution
Close
Hashes for villaProductSdk-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e280572309d9230c941dd7e68e618deb74b7833cb45d5fc86ca993b9541cba25 |
|
MD5 | bc6d7ffe5ac039e10c363e76c26b2996 |
|
BLAKE2b-256 | 7e6f2fa94a43296763f6988d93526dbd82d4c79b5613781cd7d698386480b25b |