Numpy Array type compatible with Pydantic
Project description
Nudantic
Numpy Array type compatible with Pydantic
from pydanctic import BaseModel
from nudantic import NdArray
class MyModel(BaseModel):
array: NdArray
MyModel(array=np.array([1, 2, 3])).model_dump_json()
# {'array': [1, 2, 3]}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nudantic-0.1.3.tar.gz
(1.6 kB
view hashes)