Skip to main content

A description of your project

Project description

villaInventorySdk

Install

pip install villaInventorySdk

How to use

Uploading a large amount of data

sample input

sampleInput = [ 
  {'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

init sdk

%%time
sdk = InventorySdk(user=USER, pw=PW, branchName = branch)
CPU times: user 28.5 ms, sys: 12 ms, total: 40.4 ms
Wall time: 1.05 s

Update inventory

%%time
sdk.updateWithS3( sampleInput )
CPU times: user 48.5 ms, sys: 7.17 ms, total: 55.7 ms
Wall time: 173 ms





{'body': 'true', 'statusCode': 200, 'header': {}}

Query single product

%%time
sdk.querySingleProduct('0000002')
CPU times: user 14.4 ms, sys: 0 ns, total: 14.4 ms
Wall time: 2.05 s





{'body': '{"ib_prcode":"0000002","1000":{"ib_cf_qty":35,"new_ib_bs_stock_cv":33,"lastUpdate":1600567810.529301},"1001":{"ib_cf_qty":32,"new_ib_bs_stock_cv":30,"lastUpdate":1600567810.529316},"1002":{"ib_cf_qty":34,"new_ib_bs_stock_cv":30,"lastUpdate":1600567810.529318},"lastUpdate":1600567810.529318}',
 'statusCode': 200,
 'header': {}}

Query Branch

%%time
result = sdk.queryBranch('1000')
#showing the first 2 result
list(iter(result.items()))[:2]
CPU times: user 271 ms, sys: 12.6 ms, total: 283 ms
Wall time: 507 ms





[('0000009',
  {'ib_cf_qty': 50,
   'new_ib_bs_stock_cv': 27,
   'lastUpdate': 1602338504.869655}),
 ('0000002',
  {'ib_cf_qty': 35,
   'new_ib_bs_stock_cv': 33,
   'lastUpdate': 1600567810.529301})]

Query All

%%time
result = sdk.queryAll()
list(iter(result.items()))[:2]
CPU times: user 1.63 s, sys: 48.7 ms, total: 1.67 s
Wall time: 1.96 s





[('0000009',
  {'ib_prcode': '0000009',
   '1000': {'ib_cf_qty': 50,
    'new_ib_bs_stock_cv': 27,
    'lastUpdate': 1602338504.869655},
   'lastUpdate': 1602338504.869655}),
 ('0000002',
  {'ib_prcode': '0000002',
   '1000': {'ib_cf_qty': 35,
    'new_ib_bs_stock_cv': 33,
    'lastUpdate': 1600567810.529301},
   '1001': {'ib_cf_qty': 32,
    'new_ib_bs_stock_cv': 30,
    'lastUpdate': 1600567810.529316},
   '1002': {'ib_cf_qty': 34,
    'new_ib_bs_stock_cv': 30,
    'lastUpdate': 1600567810.529318},
   'lastUpdate': 1600567810.529318})]

Project details


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.14.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

villaInventorySdk-0.0.14-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file villaInventorySdk-0.0.14.tar.gz.

File metadata

  • Download URL: villaInventorySdk-0.0.14.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for villaInventorySdk-0.0.14.tar.gz
Algorithm Hash digest
SHA256 107b2763e44bcea842c553b02e920d750228234da6f619ea5413af6edc487c27
MD5 f109d0202156fec3bab52b8a0ae76fde
BLAKE2b-256 1b2bc0eb64eb543af58a0e7c55ca6d26a574fbb2ededfaaac8628c0b8af93bb1

See more details on using hashes here.

File details

Details for the file villaInventorySdk-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: villaInventorySdk-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for villaInventorySdk-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b78b111538a2febc607a32079ee6fd50138141f2fd19539f36fc7f45723c30
MD5 1df01fd26dbaa9a4d11978dd7f346651
BLAKE2b-256 0a63c9f0012af601c7db4b11e0b85163b93b121ed88a4175c11ed9c716045489

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page