Skip to content

Commit

Permalink
add logger (#7)
Browse files Browse the repository at this point in the history
* init datamodell

* add logger

Co-authored-by: kevin <68426071+hf-krechan@users.noreply.github.com>

* changed logger to loguru

* added examples to some docstrings

---------

Co-authored-by: kevin <68426071+hf-krechan@users.noreply.github.com>
  • Loading branch information
DeltaDaniel and hf-krechan authored Mar 5, 2024
1 parent 6c995d3 commit ff385dd
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = ["pydantic"] # add all the dependencies here
dependencies = ["pydantic", "loguru"] # add all the dependencies here
dynamic = ["readme", "version"]

[project.urls]
Expand Down
14 changes: 6 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
#
annotated-types==0.6.0
# via pydantic
distlib==0.3.8
# via virtualenv
filelock==3.13.1
# via virtualenv
platformdirs==4.2.0
# via virtualenv
colorama==0.4.6
# via loguru
loguru==0.7.2
# via migmose (pyproject.toml)
pydantic==2.6.3
# via migmose (pyproject.toml)
pydantic-core==2.16.3
Expand All @@ -20,5 +18,5 @@ typing-extensions==4.10.0
# via
# pydantic
# pydantic-core
virtualenv==20.25.1
# via migmose (pyproject.toml)
win32-setctime==1.1.0
# via loguru
13 changes: 12 additions & 1 deletion src/migmose/mig/nachrichtenstrukturzeile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@

class NachrichtenstrukturZeile(BaseModel):
"""
class for lines in mig tables
class for lines in mig tables, e.g. (ORDCHG):
{
"zaehler": "0010",
"nr": "1",
"bezeichnung": "UNH",
"standard_status": "M",
"bdew_status": "M",
"standard_maximale_wiederholungen": 1,
"bdew_maximale_wiederholungen": 1,
"ebene": 0,
"inhalt": "Nachrichten-Kopfsegment"
}
"""

zaehler: str
Expand Down
49 changes: 47 additions & 2 deletions src/migmose/mig/segmentgruppe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,53 @@

class SegmentGruppe(NachrichtenstrukturZeile):
"""
class for structured segmentgroups in mig tables. builds table recursively. inherits from NachrichtenstrukturZeile
class for structured segmentgroups in mig tables. Builds table recursively. Inherits from NachrichtenstrukturZeile
e.g.(ORDCHG):
{
"segmente": [
{
"zaehler": "0160",
"nr": "7",
"bezeichnung": "NAD",
"standard_status": "M",
"bdew_status": "M",
"standard_maximale_wiederholungen": 1,
"bdew_maximale_wiederholungen": 1,
"ebene": 1,
"inhalt": "MP-ID Absender"
}
],
"segmentgruppen": [
{
"segmente": [
{
"zaehler": "0260",
"nr": "8",
"bezeichnung": "CTA",
"standard_status": "M",
"bdew_status": "M",
"standard_maximale_wiederholungen": 1,
"bdew_maximale_wiederholungen": 1,
"ebene": 2,
"inhalt": "Ansprechpartner"
},
{
"zaehler": "0270",
"nr": "9",
"bezeichnung": "COM",
"standard_status": "C",
"bdew_status": "R",
"standard_maximale_wiederholungen": 5,
"bdew_maximale_wiederholungen": 5,
"ebene": 3,
"inhalt": "Kommunikationsverbindung"
}
],
"segmentgruppen": []
}
]
}
"""

segmente: list[NachrichtenstrukturZeile]
segmentgruppe: list["SegmentGruppe"]
segmentgruppen: list["SegmentGruppe"]

0 comments on commit ff385dd

Please sign in to comment.