A description of your project
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
sdk = InventorySdk(user=USER, pw=PW)
result = sdk.querySingleProduct(ib_prcode = '84621')
result
b'{"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
villaInventorySdk-0.0.8.tar.gz
(11.9 kB
view hashes)
Built Distribution
Close
Hashes for villaInventorySdk-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1114a18b70e3a19d2ef68ccd7f067080c37904c90ae43ee7d18ce7a667faf8f9 |
|
MD5 | 66e6e6c0d6fab76f6891b80f16369d9c |
|
BLAKE2b-256 | 5ea67c0c5a76b4eb95d32167e9ed96c1d1d4faec771ebccdcae348cfe8ae44a7 |