Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init datamodel #6

Merged
merged 8 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# to update all repo revisions just run: pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.2.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
Expand Down
4 changes: 2 additions & 2 deletions dev_requirements/requirements-formatting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ packaging==23.0
# via black
pathspec==0.11.0
# via black
platformdirs==3.1.0
platformdirs==4.2.0
# via black
tomli==2.0.1
# via black
typing-extensions==4.9.0
typing-extensions==4.10.0
# via black
4 changes: 2 additions & 2 deletions dev_requirements/requirements-linting.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ isort==5.13.2
# via pylint
mccabe==0.7.0
# via pylint
platformdirs==3.1.0
platformdirs==4.2.0
# via pylint
pylint==3.1.0
# via -r dev_requirements/requirements-linting.in
tomli==2.0.1
# via pylint
tomlkit==0.11.6
# via pylint
typing-extensions==4.9.0
typing-extensions==4.10.0
# via astroid
2 changes: 1 addition & 1 deletion dev_requirements/requirements-type_check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ mypy-extensions==1.0.0
# via mypy
tomli==2.0.1
# via mypy
typing-extensions==4.9.0
typing-extensions==4.10.0
# via mypy
1 change: 1 addition & 0 deletions domain-specific-terms.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# contains 1 lower case word per line which are ignored in the spell_check
segmente
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 = [] # add all the dependencies here
dependencies = ["pydantic"] # add all the dependencies here
dynamic = ["readme", "version"]

[project.urls]
Expand Down
20 changes: 19 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile pyproject.toml
#
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
pydantic==2.6.2
# via migmose (pyproject.toml)
pydantic-core==2.16.3
# via pydantic
typing-extensions==4.10.0
# via
# pydantic
# pydantic-core
virtualenv==20.25.1
# via migmose (pyproject.toml)
Empty file added src/migmose/mig/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions src/migmose/mig/baumdiagramm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
contains class for trees consisting of segments of mig tables
"""

from migmose.mig.nachrichtenstrukturzeile import NachrichtenstrukturZeile


class BaumSegmentGruppe(NachrichtenstrukturZeile):
"""will contain the tree structure of nachrichtenstruktur tables"""

segmente: list[NachrichtenstrukturZeile]
segmentgruppe: list["BaumSegmentGruppe"]
15 changes: 15 additions & 0 deletions src/migmose/mig/nachrichtenstruktur.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
contains class mig tables
"""

from pydantic import BaseModel

from migmose.mig.nachrichtenstrukturzeile import NachrichtenstrukturZeile


class NachrichtenstrukturTabelle(BaseModel):
"""
class for mig tables
"""

lines: list[NachrichtenstrukturZeile]
21 changes: 21 additions & 0 deletions src/migmose/mig/nachrichtenstrukturzeile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
contains class for lines in mig tables
"""

from pydantic import BaseModel


class NachrichtenstrukturZeile(BaseModel):
"""
class for lines in mig tables
"""

zaehler: str
nr: str
bezeichnung: str
standard_status: str
bdew_status: str
standard_maximale_wiederholungen: int
bdew_maximale_wiederholungen: int
ebene: int
inhalt: str
14 changes: 14 additions & 0 deletions src/migmose/mig/segmentgruppe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
contains class for structured segmentgroups in mig tables. Builds table recursively.
"""

from migmose.mig.nachrichtenstrukturzeile import NachrichtenstrukturZeile


class SegmentGruppe(NachrichtenstrukturZeile):
"""
class for structured segmentgroups in mig tables. builds table recursively. inherits from NachrichtenstrukturZeile
"""

segmente: list[NachrichtenstrukturZeile]
segmentgruppe: list["SegmentGruppe"]
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ envlist =
linting
coverage
type_check
spell_check
skip_missing_interpreters = True
skipsdist = True

Expand Down