{"library":"pydantic-numpy","title":"Pydantic NumPy","description":"Integrate NumPy arrays into Pydantic models with type validation, shape constraints, and dtype checking. Currently version 9.0.1 (requires Python >=3.11, <3.15). Active development with frequent breaking changes across major versions.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install pydantic-numpy"],"cli":null},"imports":["from pydantic_numpy import NDArray","from pydantic_numpy import NumpyModel","from pydantic_numpy import numpy_array"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pydantic_numpy import NumpyModel, numpy_array\n\nclass MyModel(NumpyModel):\n    data: numpy_array(shape=(3, 4), dtype=float)\n\narray_instance = MyModel(data=[[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0], [9.0, 10.0, 11.0, 12.0]])\nprint(array_instance.data)","lang":"python","description":"Create a Pydantic model with a validated NumPy array field; shape and dtype constraints are enforced.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}