You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+48
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,54 @@ assert {awf.pruefidentifikator for awf in ahb.anwendungsfaelle} == {
79
79
80
80
Die vollständigen Beispiele finden sich in den [unittests](unittests).
81
81
82
+
### Verwendung mit Pydantic
83
+
Per default verwendet fundamend die [dataclasses aus der Python-Standardlibrary](https://docs.python.org/3/library/dataclasses.html).
84
+
Es lässt sich aber auch direkt mit [Pydantic](https://docs.pydantic.dev/latest/) und den [Pydantic dataclasses](https://docs.pydantic.dev/2.7/concepts/dataclasses/) verwenden.
85
+
Wenn entweder pydantic schon installiert ist, oder mittels
86
+
```bash
87
+
pip install fundamend[pydantic]
88
+
```
89
+
mit installiert wird, dann sind Datenmodelle, die von `AhbReader` und `MigReader` zurückgegeben werden, automatisch pydantic Objekte.
90
+
91
+
Mit Pydantic können die Ergebnisse auch leicht bspw. als JSON exportiert werden:
92
+
```python
93
+
from pathlib import Path
94
+
95
+
from pydantic import RootModel
96
+
from fundamend import Anwendungshandbuch, AhbReader
0 commit comments