-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experimental: Build pydantic from schema
- Loading branch information
JB Lovland
committed
Jan 11, 2024
1 parent
b204db8
commit cc39ad7
Showing
3 changed files
with
522 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
datamodel-codegen \ | ||
--disable-timestamp \ | ||
--enable-version-header \ | ||
--enum-field-as-literal one \ | ||
--field-constraints \ | ||
--input $1 \ | ||
--input-file-type "jsonschema" \ | ||
--output-model-type pydantic_v2.BaseModel \ | ||
--snake-case-field \ | ||
--strict-nullable \ | ||
--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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ dependencies = [ | |
"numpy", | ||
"pandas", | ||
"pyarrow", | ||
"pydantic>=2.0.0", | ||
"PyYAML", | ||
"xtgeo>=2.16", | ||
] | ||
|
Oops, something went wrong.