{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/16"}],"enrichment":{"capability":"Integrates NumPy arrays into Pydantic models with type validation, allowing you to define, validate, serialize, and deserialize NumPy arrays as model fields.","skillfed_tags":["numpy-integration","data-validation","serialization"],"use_cases":["Validate and serialize machine-learning model inputs/outputs that include NumPy arrays as Pydantic models.","Define strict dtype and dimension requirements for arrays in data pipelines (e.g., float32 1D arrays only).","Persist Pydantic models containing arrays to disk and reload them with automatic type checking.","Generate JSON schemas for APIs that accept or return NumPy array data.","Combine NumPy arrays with other Pydantic fields in a single validated data structure."],"what_it_does":"pydantic-numpy bridges NumPy arrays and Pydantic's validation and serialization framework. It provides typed annotations (like NpNDArrayFp64 for 3D float64 arrays) that work with both BaseModel and dataclass, plus a NumpyModel class for seamless dump/load of arrays to disk. You can instantiate models from raw arrays, NumPy .npy files, or .npz files with keys, and serialize to JSON with full schema compliance.\n\nThe package handles the impedance mismatch between NumPy's array semantics and Pydantic's type system by wrapping arrays in validated fields. It supports custom serialization, dimension constraints, dtype specification, and model-agnostic loading when multiple models might match. Runtime dependencies are minimal and well-established (pydantic, numpy, ruamel-yaml, compress-pickle, semver).","worth_installing":"Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and solves a real gap in Pydantic's NumPy support. It's suitable for production use if you need to validate and serialize NumPy arrays within Pydantic models. The permissive BSD-3-Clause license poses no restriction."},"id":"pydantic-numpy","links":{"html":"https://skillfed.io/packages/pydantic-numpy","md":"https://skillfed.io/packages/pydantic-numpy.md","pypi":"https://pypi.org/project/pydantic-numpy/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-01","license_spdx":null,"license_treatment":"permissive","name":"pydantic-numpy","python_support":"supports_current","summary":"Pydantic Model integration of the NumPy array"},"popularity":{"monthly_downloads":178398,"position":10194,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"9.0.2"}
