DGTL Health BV NEN7513 compliant logging objects
Project description
dgtl-logging
NEN7513 compliant logging library according to the current scope of DGTL Health BV
Updating
- update
setup.py
with new version number - push or merge pull request to master branch and a github action will build and publish the package
Installing
pip install dgtl-logging
Usage
EventObject, UserObject and CustomObject
Usage of the EventObject
and UserObject
are similar and have a validate() method built-in. The CustomObject
does not have predefined parameters.
Use the validate()
method just before passing the object to your logging function.
from dgtl_logging.dgtl_logging import CustomObject, EventObject, UserObject
event = EventObject()
event.update_parameters(gebeurteniscode='code1')
event.update_parameters(actiecode='action1', utcisodatetime='2023-10-10T00:00:00Z')
event.update_parameters(identificatortype='type1', identificator='id1', aard='typeA')
To validate if all required parameters are filled: event.validate()
Writing to the logging ledger
DGTLLogging can be initiated as follows dgtl_logging = DGTLLogging(log_ledger_table=log_ledger_table, env='test')
. Where log_ledger_table
is the logging table in the chosen ledger. env
is the environment (i.e. dev, acc, prod, etc.).
When all required parameters are added to the EventObject
and UserObject
you can pass them to resp = dgtl_logging.add_log(event_object=event, user_object=user)
, which returns True
when the insertion was succesful and raises an error otherwise.
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
Built Distribution
File details
Details for the file dgtl_logging-0.1.0.tar.gz
.
File metadata
- Download URL: dgtl_logging-0.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bad788dd03221b7594338159d48259e55b7e3c870ccf7ea0437b484131e052c7 |
|
MD5 | 10e574e6eb3af33cf3895cf0090c63bf |
|
BLAKE2b-256 | 21a56e61adec7e968268b3f809a689b1126ef0c5e365cfdcde6b342e92df1166 |
File details
Details for the file dgtl_logging-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: dgtl_logging-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb8b1bf69461a7fd85df8810a291c79abc10befa1fa667a7501983e9729fbf9c |
|
MD5 | 63cbabc92806c0308209704197d20d8f |
|
BLAKE2b-256 | 48f2c824ac53181b4359b5d0fbfbc6d5af2fef90314270e00dc247ae49e0c33a |