Progress API for the Data Analytics Software Framework (DASF)
DASF: Progress API is part of the Data Analytics Software Framework (DASF, https://codebase.helmholtz.cloud/dasf),
developed at the GFZ German Research Centre for Geosciences (https://www.gfz-potsdam.de).
It is funded by the Initiative and Networking Fund of the Helmholtz Association through the Digital Earth project
(https://www.digitalearth-hgf.de/).
DASF: Progress API provides a light-weight tree-based structure to be sent via the DASF RCP messaging protocol.
It's generic design supports deterministic as well as non-deterministic progress reports.
While DASF: Messaging Python provides the necessary implementation to distribute
the progress reports from the reporting backend modules,
DASF: Web includes ready to use components to visualize the reported progress.
Installation
Install this package in a dedicated python environment via
python -m venv venv
source venv/bin/activate
pip install deprogessapi
To use this in a development setup, clone the source code from gitlab, start the development server and make your changes::
git clone https://codebase.helmholtz.cloud/dasf/dasf-progress-api
cd dasf-progress-api
python -m venv venv
source venv/bin/activate
make dev-install
More detailed installation instructions my be found in the docs.
Usage
A progress report is stored in a tree structure. So there will be one 'root' report instance containing multiple 'sub-reports'.
In order to report the progress simply add a reporter argument with type ProgressReport to the exposed method, e.g.
from deprogressapi import ProgressReport
def some_exposed_method(reporter: Optional[ProgressReport] = ProgressReport(
step_message="some progress message")) -> str:
# ...
For a report instance new subreports can be created via the create_subreport method.
Each created report is published (sent to the requesting client) automatically upon creation and on completion.
# create a subreport
sub_report = root_report.create_subreport(step_message="Calculating something")
# execute some logic
# ...
# mark the sub-report as compelte
sub_report.complete()
All sub-reports are again instances of ProgressReport, so you can create more sub-reports for each.
error handling
In order to report an error, you provide an error status argument to the complete method. The corresponding error message can be set via the reports step_message field.
from deprogressapi.base import Status
# ...
# some code that raises an exception
# ...
except Exception as e:
error = str(e)
progress_report.step_message = "error '{msg}': {err}".format(msg=progress_report.step_message, err=error)
progress_report.complete(Status.ERROR)
Recommended Software Citation
Eggert et al., (2022). DASF: A data analytics software framework for distributed environments. Journal of Open Source Software, 7(78), 4052, https://doi.org/10.21105/joss.04052
Technical note
This package has been generated from the template https://codebase.helmholtz.cloud/hcdc/software-templates/python-package-template.git.
See the template repository for instructions on how to update the skeleton for this package.
License information
Copyright © 2020-2024 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences
Code files in this repository are licensed under the Apache-2.0, if not stated otherwise in the file.
Documentation files in this repository are licensed under CC-BY-4.0, if not stated otherwise in the file.
Supplementary and configuration files in this repository are licensed under CC0-1.0, if not stated otherwise in the file.
Please check the header of the individual files for more detailed information.
License management
License management is handled with reuse.
If you have any questions on this, please have a look into the
contributing guide or contact the maintainers of
dasf-progress-api.
Metadata
Release files for deprogressapi 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| deprogressapi-0.4.3.tar.gz | 23.4 kB | Without provenance | Details for deprogressapi-0.4.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| deprogressapi-0.4.3-py3-none-any.whl | Python 3 | none | any | Details for deprogressapi-0.4.3-py3-none-any.whl |
Total release size: 47.4 kB
Release files / deprogressapi-0.4.3.tar.gz
| Download URL | deprogressapi-0.4.3.tar.gz |
|---|---|
| Size | 23.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37e97a10debf5a38ceb142d4bf3e6c64ba3f723d7ced7428b3e44a3982e81d8c
|
|
BLAKE2b-256 checksum How to use checksums |
801639cb7d1722c6bb0453369db1669eda2128dfec9ddd74b0822d813c050f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Release files / deprogressapi-0.4.3-py3-none-any.whl
| Download URL | deprogressapi-0.4.3-py3-none-any.whl |
|---|---|
| Size | 23.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2edcd927365a19160c065a23ddfa7767f0938cc53a754e99782c3ea9771b942b
|
|
BLAKE2b-256 checksum How to use checksums |
f9c6635d776811ac93accf7967a3aa05ceac53f175aa5b18089315dd404c941f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.11
|
Security for deprogressapi 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.