dhi-python
Installation
Review the source and dependencies with a prompt.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "dhi-python" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d1843d29c9b89b3d604f44fc24b439b7b3ad799a22705960da262c00fb9c8f8a. Verify the upstream source and version against https://github.com/justrach/dhi before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
A complete, approved package is not available yet.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Defines data models and validates inputs through a Python BaseModel interface. It uses a native Zig implementation with an interface modeled on Pydantic v2.
Introduction source: third_party · justrach · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Ultra-fast data validation library for Python (520x faster than Pydantic). Use when building validated data models, API request/response schemas, or configuration objects. Provides Pydantic v2-compatible BaseModel API with Zig-powered native validation.
- Audience
- Use dhi when: Building high-performance APIs (FastAPI, Flask, etc.) Processing large volumes of validated data Need Pydantic compatibility with better performance Building configuration systems with validation
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- ```python from dhi import Field
- Testing
- Not tested
Browse files
A verified file list is not available on Skillπ yet.
Browse files at the source ↗Skillπ does not display the original SKILL.md on this page. View the original source ↗ The source site governs the file contents, license, and use terms.
Version history
-
v1.7.0
GitHub ↗
Original release notes
Codecs, real async parsing, and the remaining Zod 4 API surface. Published to npm with SLSA provenance via an OIDC trusted publisher. ## Added - **Codecs** — `z.codec(input, output, { decode, encode })` plus `z.encode`/`decode`/ `safeEncode`/`safeDecode` (and `*Async`) and matching methods on every schema. Encoding runs the schema backwards through codecs, pipes and `z.stringbool()`, and refuses one-way `.transform()`s with a `ZodEncodeError`. - **Real async parsing** — `.parseAsync()` / `.safeParseAsync()` / `.spa()` await async refinements, superRefinements, transforms and `.check()` callbacks, including when nested in objects, arrays, tuples, records, sets, maps, unions and wrappers. A synchronous `.parse()` that meets one throws `ZodAsyncError` instead of leaking a Promise. - **Error helpers** — `z.treeifyError()`, `z.flattenError()`, `z.formatError()`, all with the optional issue mapper. `ZodError` is now an `Error` with a lazily built `.stack` and gains `.isEmpty`, `.addIssue()`, `.addIssues()`. - **Top-level functional API** — `z.parse`/`safeParse`/`parseAsync`/`safeParseAsync`, `z.transform`, `z.catch`, `z.default`, `z.prefault`, `z.nullish`, `z.nonoptional`, `z.readonly`, `z.exactOptional`, `z.keyof`, `z.clone`, `z.xor`, `z.stringFormat`, `z.slugify`, `z.describe`, `z.meta`, `z.fromJSONSchema`. - **Constants and namespaces** — `z.NEVER`, `z.TimePrecision`, `z.ZodIssueCode`, `z.$brand`, `z.regexes`, `z.util`, `z.core`, `z.locales`, `z.config()`, `z.getErrorMap()`, `z.setErrorMap()`, and runtime `z.ZodString` / `z.ZodObject` / … class aliases. - **Schema introspection** — `.type`, `.apply()`, `.with()`, `.toJSONSchema()`, `.spa()` on every schema, plus `.format`/`.minValue`/`.maxValue`/`.isInt` on numbers, `.minDate`/ `.maxDate` on dates, `.element` on arrays, `.keyType`/`.valueType` on records and maps. - `z.object().safeExtend()`, `z.tuple(items, rest)`, `z.map().min/max/size/nonempty()`, `z.function().implementAsync()`, `z.string().slugify()`. - `z.toJSONSchema()` accepts `target`, `metadata`, `unrepresentable`, `override` and `io`, and emits Zod's document shape. `.meta()` registers in `z.globalRegistry`. ## Changed - Issues carry Zod 4 codes natively (`invalid_format`, `invalid_value`, `invalid_union`); Zod 3 spellings passed to `ctx.addIssue()` are still accepted and normalised. - `.prefault(v)` runs the fallback through the schema; `.default(v)` still short-circuits. - `.transform()` receives Zod's `ctx`; `.catch()` receives `{ value, issues, error, input }`; `.refine()` accepts `{ when, abort, path, message, error }`. - `z.prettifyError()` uses Zod's layout; `error.flatten()` keys `fieldErrors` like Zod. - `.extend()`, `.pick()`, `.omit()`, `.partial()`, `.required()` keep the object's unknown-key policy. - `z.discriminatedUnion()` resolves discriminators through optional, nullable, enum and nested-union options. ## Performance Zig core JSON parse/validate paths use a stack-owned arena instead of a heap-allocated `Parsed` wrapper, and `json_batch_validator` is now part of `zig build test`. (#80) The differential parity suite is now 283 schemas / 4,961 checks against `[email protected]` with zero mismatches, and dhi remains faster than Zod on every benchmark row.
-
v1.6.0
GitHub ↗
Original release notes
Zod 4 core compatibility, one runtime-agnostic core, and Windows wheels. ## Zod 4 core internals (#76) Every dhi schema now exposes Zod 4's internals (`_zod.def`, `_zod.run`, `optin`/`optout`, `values`, the JSON-Schema hook) and is assignable to Zod's `$ZodType` at the type level. Libraries that detect Zod 4 schemas and call Zod's own core helpers work unchanged: - `@modelcontextprotocol/sdk` `registerTool` / `registerPrompt` — object schemas, raw shapes and output schemas. `tools/list` no longer fails with `def.shape is not a function`. - `z.toJSONSchema(dhiSchema)`, `z.safeParse(dhiSchema, …)`, `instanceof z.ZodObject`. ## Single runtime-agnostic core `dhi`, `dhi/edge`, `dhi/cloudflare` and `dhi/nextjs` now re-export the same core: identical behaviour and JIT everywhere, no WASM instantiation, no top-level await, no bundler configuration. The edge and Next.js entries had drifted ~800 lines behind the Node entry. ## Behavioural parity with Zod 4 A new differential test (`tests/test-zod-parity.ts`) runs 250+ schemas over 4,400+ inputs against the real `zod` package and requires identical accept/reject decisions and identical parsed output. Closing the gaps it found changed, among others: - String formats: `uuid` checks RFC 9562 version/variant nibbles, `url` accepts any WHATWG-parsable URL, `ipv6`/`cidrv6` use the WHATWG parser, `base64`/`base64url` padding rules, leap-year-aware `date`, ISO 8601-1 `duration`, Zod's `email` rules. - `.lowercase()` / `.uppercase()` validate case (`.toLowerCase()` / `.toUpperCase()` transform). - `z.number()` rejects `Infinity`; `.int()` means safe integer; float-safe `.multipleOf()`. - Objects: absent optional keys stay absent, `.catchall()` validates unknown keys, JSON Schema `required` follows Zod's `optin`/`optout` rule with `io: 'input' | 'output'` honoured. - Tuples allow omitting trailing optional items; enum-keyed records are exhaustive (`z.partialRecord` for optional keys); `z.coerce.date()` coerces any input. ## Also added - Zod 4 standalone checks for `.check(...)`: `z.minLength`, `z.gt`/`gte`/`lt`/`lte`, `z.multipleOf`, `z.regex`, `z.refine`, `z.superRefine` and the rest of the set. - `z.uuidv4/v6/v7`, `z.xid`, `z.ksuid`, `z.hash()`, `z.httpUrl()`, `z.hostname()`, `z.hex()`, `z.stringbool()`, `z.iso.datetime()`, `z.mac()`, `z.jwt()`. - `.nonoptional()` and `.exactOptional()` as real wrappers. - `z.enum([...])` infers the literal union instead of widening to `string`. - `dhi/schema-nextjs` export alias. ## Python Windows wheels (AMD64, CPython 3.9–3.14 including free-threaded) are now built and published; the C extension compiles under MSVC. (#59)
-
v1.5.2
GitHub ↗
Original release notes
## dhi v1.5.2 **Ultra-fast Zod 4 drop-in replacement — SIMD-powered WASM + N-API native addon** ### Performance (vs Zod 4.3.6) - String validators: 1.1–2.9x faster - Number validators: up to 48x faster - Object validators: 4–7x faster (JIT-compiled) - Coercion: 25–47x faster - Zero production dependencies ### Features - Full Zod 4 API parity (drop-in replacement) - Complete TypeScript type inference - SIMD-powered WASM validators (28KB binary) - JIT-compiled object schemas - All string/number/object/array/union/enum validators ### Installation ```bash npm install [email protected] ``` ### Migration from Zod ```typescript // Before import { z } from 'zod'; // After import { z } from 'dhi'; // That's it — same API, faster runtime ```
-
v1.5.0
GitHub ↗
Original release notes
## dhi v1.5.0 **Ultra-fast Zod 4 drop-in replacement — SIMD-powered WASM + N-API native addon** ### Performance (vs Zod 4.3.6) - String validators: 1.1–2.9x faster - Number validators: up to 48x faster - Object validators: 4–7x faster (JIT-compiled) - Coercion: 25–47x faster - Zero production dependencies ### Features - Full Zod 4 API parity (drop-in replacement) - Complete TypeScript type inference - SIMD-powered WASM validators (28KB binary) - JIT-compiled object schemas - All string/number/object/array/union/enum validators ### Installation ```bash npm install [email protected] ``` ### Migration from Zod ```typescript // Before import { z } from 'zod'; // After import { z } from 'dhi'; // That's it — same API, faster runtime ```
-
v1.4.1
GitHub ↗
Original release notes
## dhi v1.4.1 **Ultra-fast Zod 4 drop-in replacement — SIMD-powered WASM + N-API native addon** ### Performance (vs Zod 4.3.6) - String validators: 1.1–2.9x faster - Number validators: up to 48x faster - Object validators: 4–7x faster (JIT-compiled) - Coercion: 25–47x faster - Zero production dependencies ### Features - Full Zod 4 API parity (drop-in replacement) - Complete TypeScript type inference - SIMD-powered WASM validators (28KB binary) - JIT-compiled object schemas - All string/number/object/array/union/enum validators ### Installation ```bash npm install [email protected] ``` ### Migration from Zod ```typescript // Before import { z } from 'zod'; // After import { z } from 'dhi'; // That's it — same API, faster runtime ```
Only the five most recent versions are shown. View full version history at the source ↗
Current listing version
0.0.1
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供高性能数据验证库的完整使用指南,适用于API开发和配置验证等实际场景
- 详细说明了与Pydantic的兼容性,便于用户迁移
Highlights
- 触发描述清晰准确,涵盖了主要使用场景和技术特性
Highlights
- 文档结构完整,章节划分清晰,包含丰富的代码示例和性能对比数据
Highlights
- 提供了正确的安装命令和全面的API使用示例,执行风险低
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
No text check results available.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
The main document is unavailable or exceeds this check’s scope; permissions are unknown.
Security rating and access scope
risk · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.