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: examples/dict_to_schema/README.md
+32-14Lines changed: 32 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Dict to Schema
2
2
3
-
This example demonstrates how to automatically convert Python dictionary literals into Pydantic models. The codemod makes this process simple by handling all the tedious manual updates automatically.
3
+
This example demonstrates how to automatically convert Python dictionary literals into dataclasses with proper type hints. The codemod makes this process simple by handling all the tedious manual updates automatically.
4
4
5
5
## How the Conversion Script Works
6
6
@@ -17,9 +17,9 @@ The script (`run.py`) automates the entire conversion process in a few key steps
17
17
- Maintains proper Python indentation
18
18
19
19
3.**Code Updates**
20
-
- Inserts new Pydantic models in appropriate locations
21
-
- Updates dictionary assignments to use the new models
22
-
- Automatically adds required Pydantic imports
20
+
- Inserts new dataclass definitions in appropriate locations
21
+
- Updates dictionary assignments to use the new dataclasses
22
+
- Automatically adds required imports for dataclasses and typing
23
23
24
24
## Example Transformations
25
25
@@ -29,26 +29,44 @@ The script (`run.py`) automates the entire conversion process in a few key steps
0 commit comments