Skip to main content

basic back-end progress api for the data analytics software framework dasf

Project description

DASF Logo

PyPI version

dasf-progress-api

DASF: Progress API is part of the Data Analytics Software Framework (DASF, https://git.geomar.de/digital-earth/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.

Service Desk

For everyone without a Geomar Gitlab account, we setup the Service Desk feature for this repository. It lets you communicate with the developers via a repository specific eMail address. Each request will be tracked via the Gitlab issuse tracker.

eMail: gitlab+digital-earth-dasf-dasf-progress-api-2274-issue-@git-issues.geomar.de

PyPI Package deprogressapi

PyPI version

DASF: Progress API is released as a PyPI package called deprogressapi.

You may install it via:

pip install deprogressapi

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, Daniel; Dransch, Doris (2021): DASF: Progress API: A progress reporting structure for the data analytics software framework. V. v0.1.4. GFZ Data Services. https://doi.org/10.5880/GFZ.1.4.2021.007

License

Copyright 2021 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany / DASF Data Analytics Software Framework

Licensed under the Apache License, Version 2.0 (the "License");
you may not use these files except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Contact

Dr.-Ing. Daniel Eggert
eMail: daniel.eggert@gfz-potsdam.de

Helmholtz Centre Potsdam GFZ German Research Centre for Geoscienes
Section 1.4 Remote Sensing & Geoinformatics
Telegrafenberg
14473 Potsdam
Germany

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

deprogressapi-0.3.0.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

deprogressapi-0.3.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file deprogressapi-0.3.0.tar.gz.

File metadata

  • Download URL: deprogressapi-0.3.0.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.28.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for deprogressapi-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9691e96e7b7a680f888e60ce1f7088cf955d40d7facbde9938b12e0784e23504
MD5 4b8813ef478cec7d504e40376f248450
BLAKE2b-256 7e3214120293e6aa8a0aacf7155272792853b8b9268b7d9c0618c8da343be433

See more details on using hashes here.

File details

Details for the file deprogressapi-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: deprogressapi-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.28.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4

File hashes

Hashes for deprogressapi-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66e35198321bec27633172cd70513778ebd64f5928cafc83dd4056437bebe076
MD5 169b07df8042694820469ebade661b47
BLAKE2b-256 51de7b8df7894479d624ba1ab804f55d62b8d240226c8986e62f87a007b805b4

See more details on using hashes here.

Supported by

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