Job execution utilities
Project description
Informatics Matters Data Manager Job Utilities
A Python 2/3 package that simplifies the generation of events and cost lines written to the Job’s stdout stream.
The following utilities are available: -
DmLog.emit_event()
DmLog.emit_cost()
Installation (Python)
The Job utilities are published on PyPI and can be installed from there:
pip install im-data-manager-job-utilities
Once installed you can use the available classes:
>>> from dm_job_utilities.dm_log import DmLog >>> DmLog.emit_event('Hello World!') 2022-02-03T16:39:27+00:00 # INFO -EVENT- Hello World! >>> from decimal import Decimal >>> DmLog.emit_cost(Decimal('5.7')) 2022-02-03T16:40:16+00:00 # INFO -COST- 5.7 1
Costs are total by default but can be issued as an incremental value:
>>> DmLog.emit_cost(Decimal('0.5'), incremental=True) 2022-02-03T16:40:16+00:00 # INFO -COST- +0.5 2
The final value on each cost line is a unique sequence number. This value is typically an integer that increments with each line. It is required and is used by the Data Manager to avoid duplicating costs.
Get in touch
Report bugs, suggest features or view the source code on GitHub.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for im_data_manager_job_utilities-1.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bca380720a768e23c7afef5153f33798be3ed94895dce73d81b12d8f3e89f830 |
|
MD5 | d096c8a0aa48926e0723938aaef28798 |
|
BLAKE2b-256 | 25d4bb75ba5fb926ce555951129c722a0627af489af32dbf0d0582ba520d6b8e |