Skip to content

Commit

Permalink
experimental: Build pydantic from schema
Browse files Browse the repository at this point in the history
  • Loading branch information
JB Lovland committed Jan 10, 2024
1 parent 0027e1d commit fee1649
Show file tree
Hide file tree
Showing 3 changed files with 515 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
datamodel-codegen \
--input $1 \
--input-file-type "jsonschema" \
--output-model-type "pydantic_v2.BaseModel" \
--target-python-version "3.8" \
--use-default-kwarg \
--use-double-quotes \
--use-schema-description \
--use-standard-collections \
--use-subclass-enum \
--use-title-as-name \
--use-union-operator \
--use-unique-items-as-set
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies = [
"numpy",
"pandas",
"pyarrow",
"pydantic>=2.0.0",
"PyYAML",
"xtgeo>=2.16",
]
Expand Down
Loading

0 comments on commit fee1649

Please sign in to comment.