diff --git a/pkgs/development/python-modules/json-schema-to-pydantic/default.nix b/pkgs/development/python-modules/json-schema-to-pydantic/default.nix new file mode 100644 index 000000000000..95fe4833768e --- /dev/null +++ b/pkgs/development/python-modules/json-schema-to-pydantic/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + hatch-vcs, + pydantic, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "json-schema-to-pydantic"; + version = "0.4.9"; + pyproject = true; + + src = fetchFromGitHub { + owner = "richard-gyiko"; + repo = "json-schema-to-pydantic"; + tag = "v${finalAttrs.version}"; + hash = "sha256-j3E3jkb9l5s4JnGeBACG4/GznB1F+S2Fh0ncZEvvXuM="; + }; + + build-system = [ + hatchling + hatch-vcs + ]; + + dependencies = [ pydantic ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "json_schema_to_pydantic" ]; + + meta = { + description = "Generates Pydantic v2 models from JSON Schema definitions"; + homepage = "https://github.com/richard-gyiko/json-schema-to-pydantic"; + changelog = "https://github.com/richard-gyiko/json-schema-to-pydantic/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aos ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 566ff9ef990e..2a25d9f19ead 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7818,6 +7818,8 @@ self: super: with self; { json-schema-for-humans = callPackage ../development/python-modules/json-schema-for-humans { }; + json-schema-to-pydantic = callPackage ../development/python-modules/json-schema-to-pydantic { }; + json-stream = callPackage ../development/python-modules/json-stream { }; json-stream-rs-tokenizer = callPackage ../development/python-modules/json-stream-rs-tokenizer { };