Skip to main content

villa members and wallet database interaction code

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 36.6 ms, sys: 4.73 ms, total: 41.3 ms
Wall time: 1.05 s

Update inventory

%%time
sdk.updateWithS3( sampleInput )
CPU times: user 53.4 ms, sys: 2.56 ms, total: 55.9 ms
Wall time: 322 ms





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

Query single product

%%time
sdk.querySingleProduct('0000002')
CPU times: user 6.71 ms, sys: 7.73 ms, total: 14.4 ms
Wall time: 83.5 ms





{'ib_prcode': '0000002',
 '1000': {'ib_cf_qty': 35,
  'new_ib_bs_stock_cv': 33,
  'lastUpdate': 1600567810.529301,
  'ib_prcode': '0000002',
  'ib_brcode': '1000'},
 '1001': {'ib_cf_qty': 32,
  'new_ib_bs_stock_cv': 30,
  'lastUpdate': 1600567810.529316,
  'ib_prcode': '0000002',
  'ib_brcode': '1001'},
 '1002': {'ib_cf_qty': 34,
  'new_ib_bs_stock_cv': 30,
  'lastUpdate': 1600567810.529318,
  'ib_prcode': '0000002',
  'ib_brcode': '1002'},
 'lastUpdate': 1600567810.529318}

Query Branch

%%time
result = sdk.queryBranch('1000')
#showing the first 2 result
list(iter(result.items()))[:2]
CPU times: user 360 ms, sys: 28.1 ms, total: 388 ms
Wall time: 600 ms





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

Query All

%%time
result = sdk.queryAll()
list(iter(result.items()))[:2]
CPU times: user 2.34 s, sys: 90.4 ms, total: 2.43 s
Wall time: 2.77 s





[('0000009',
  {'ib_prcode': '0000009',
   '1000': {'ib_cf_qty': 50,
    'new_ib_bs_stock_cv': 27,
    'lastUpdate': 1602338504.869655,
    'ib_prcode': '0000009',
    'ib_brcode': '1000'},
   'lastUpdate': 1602338504.869655}),
 ('0000002',
  {'ib_prcode': '0000002',
   '1000': {'ib_cf_qty': 35,
    'new_ib_bs_stock_cv': 33,
    'lastUpdate': 1600567810.529301,
    'ib_prcode': '0000002',
    'ib_brcode': '1000'},
   '1001': {'ib_cf_qty': 32,
    'new_ib_bs_stock_cv': 30,
    'lastUpdate': 1600567810.529316,
    'ib_prcode': '0000002',
    'ib_brcode': '1001'},
   '1002': {'ib_cf_qty': 34,
    'new_ib_bs_stock_cv': 30,
    'lastUpdate': 1600567810.529318,
    'ib_prcode': '0000002',
    'ib_brcode': '1002'},
   '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

villaWalletDatabase-0.0.1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

villaWalletDatabase-0.0.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file villaWalletDatabase-0.0.1.tar.gz.

File metadata

  • Download URL: villaWalletDatabase-0.0.1.tar.gz
  • Upload date:
  • Size: 14.5 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 villaWalletDatabase-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8492a882fc7923394abe2736893c0c0879fcaea2523997d4506e5bd255841269
MD5 6dea97a446d2010aab4531c0cde9c7dc
BLAKE2b-256 5858ff631477e55821ff5168c15c3a3b0f524534c2cd64acc86908f46f7b8bb4

See more details on using hashes here.

File details

Details for the file villaWalletDatabase-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: villaWalletDatabase-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 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 villaWalletDatabase-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9fff27e8cc7ad2ce32e2ecf845ed962b03d0e23aca4d636b04327fc773cf5d7
MD5 f2a176ef2e6721fed9f27e1529901c7f
BLAKE2b-256 ba846f15cff64f34672c9ea74c5dc2729f78276f53eb334818e402ecbc5445ca

See more details on using hashes here.

Supported by

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