Package to add bwi methods into your project
Project description
BWI-lib
python client for BWI interactions
Usage
Instantiate a client
import bwi
client = bwi.Client(api_key='xxxxxxxxxxxxxxxx', workflow='shop')
Manipulate your logs
# provide step duration
with client.Step('fetch client information') as bwi:
bwi.logger.info('found client with user id %d', 18)
Metric management
# manipulate metrics
client.Step('validate order')
# Your business-oriented code goes here
# ...
total_paid = 220
# increment the income metric for this step
bwi.metrics.inc('income', total_paid)
Error-handling
# report any unknown exception to the bwi handler
try:
# Your business-oriented code goes here
except Exception as err:
bwi.handler.catch(err)
# the error is now available for this specific step
Mark a step as (un)succesful
step = bwi.Step('process order')
# Your business-oriented code goes here
step.success()
# other scenario, where thing go bad
step.failed()
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
bwi-0.1.2.tar.gz
(3.6 kB
view details)
Built Distribution
bwi-0.1.2-py3-none-any.whl
(4.6 kB
view details)
File details
Details for the file bwi-0.1.2.tar.gz
.
File metadata
- Download URL: bwi-0.1.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 547dcdb83bd0fff68658d0ae1b6a8dcf4b72af1ab2c8f675b1e579fb6be5899d |
|
MD5 | e8d1c551d0fe24f96ee3d72beac3a776 |
|
BLAKE2b-256 | fe2cafdd0349f2e54ee6a60908d2569332eb03fa5c1d28339ea39e1779c85781 |
File details
Details for the file bwi-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: bwi-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9395ae4b2b8ca3e8bb64cd4b9d2b97f7db7710320186dbf018c3237f5d768109 |
|
MD5 | ebd87a518de37240d0de95d706ee9456 |
|
BLAKE2b-256 | b2d397d59e9174a681e18b877232c4e17c4d776fb2326b1ccffebcd15ba7e07b |