PHPackages                             phel-lang/phel-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. phel-lang/phel-schema

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

phel-lang/phel-schema
=====================

Schema validation library in phel. The library inspired by zod

v0.0.1(10mo ago)214[1 issues](https://github.com/phel-lang/phel-schema/issues)MITPHPPHP &gt;=8.2CI passing

Since Jun 24Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/phel-lang/phel-schema)[ Packagist](https://packagist.org/packages/phel-lang/phel-schema)[ RSS](/packages/phel-lang-phel-schema/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

phel-schema
===========

[](#phel-schema)

Schema validation library in phel. The library inspired by zod

Basic Usage
-----------

[](#basic-usage)

Creating a simple string schema

```
(ns app
  (:require phel\schema :as z))

# creating a schema for strings
(def my-schema (z/string))

# parsing
(z/parse my-schema "tuna") # => "tuna"
(z/parse my-schema 12) # => throws ZodError

# "safe" parsing (doesn't throw error if validation fails)
(z/safe-parse my-schema "tuna") # => {:success true :data "tuna"}
(z/safe-parse my-schema 12) # => {:success false :error ZodError :issues [...]}
```

```
(ns app
  (:require phel\schema :as z))

# creating a schema for strings
(def my-schema (as-> (z/string) s
                     (z/min s 3)
                     (z/max s 10)
                     (z/regex s "/^t/")))

# parsing
(z/parse my-schema "tuna") # => "tuna"
(z/parse my-schema "a tuna") # => throws ZodError
```

Creating an object schema

```
(ns app
  (:require phel\schema :as z))

(def user-schama (z/object {
  :username (z/string)
}))

(z/parse user-schama {:username "Ludwig"})
```

### Primitives

[](#primitives)

```
(ns app
  (:require phel\schema :as z))

# primitive values
(z/string)
(z/number)
(z/bigint) # z/bigint is not yet implemented.
(z/infer user-schama) # z/infer is not yet implemented.
(z/boolean) # z/boolean is not yet implemented.
(z/date) # z/date is not yet implemented.
(z/symbol) # z/symbol is not yet implemented.

# empty types
(z/undefined) # z/undefined is not yet implemented.
(z/null) # z/null is not yet implemented.
(z/void) # accepts undefined # z/void is not yet implemented.

# catch-all types
# allows any value
(z/any) # z/any is not yet implemented.
(z/unknown) # z/unknown is not yet implemented.

# never type
# allows no values
(z/never) # z/never is not yet implemented.
```

Development
-----------

[](#development)

### Open shell

[](#open-shell)

```
docker compose build
docker compose run --rm php_cli bash
```

### Test

[](#test)

```
# vendor/bin/phel test
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance46

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~363 days

Total

2

Last Release

321d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d166420c6770c5941e10bd68b2d26501eabb432e280d8e6eba0a344bcc1e5ae?d=identicon)[Chemaclass](/maintainers/Chemaclass)

![](https://www.gravatar.com/avatar/179acd76bf9ce4197915822481df9901a4f70435e3b2152160b0b227146b9d95?d=identicon)[smeghead](/maintainers/smeghead)

---

Top Contributors

[![smeghead](https://avatars.githubusercontent.com/u/112476?v=4)](https://github.com/smeghead "smeghead (35 commits)")

---

Tags

schemavalidationzodphel

### Embed Badge

![Health badge](/badges/phel-lang-phel-schema/health.svg)

```
[![Health](https://phpackages.com/badges/phel-lang-phel-schema/health.svg)](https://phpackages.com/packages/phel-lang-phel-schema)
```

###  Alternatives

[opis/json-schema

Json Schema Validator for PHP

64236.9M185](/packages/opis-json-schema)[romaricdrigon/metayaml

Using \[Yaml|Xml|json\] schemas files to validate \[Yaml|Xml|json\]

103306.5k8](/packages/romaricdrigon-metayaml)[romegasoftware/laravel-schema-generator

Generate TypeScript Zod validation schemas from Laravel validation rules

288.2k](/packages/romegasoftware-laravel-schema-generator)[evaisse/php-json-schema-generator

A JSON Schema Generator.

20298.5k1](/packages/evaisse-php-json-schema-generator)[chubbyphp/chubbyphp-parsing

Allows parsing data of various structures, meaning the population and validation of data into a defined structure. For example, converting an API request into a Data Transfer Object (DTO).

2890.0k3](/packages/chubbyphp-chubbyphp-parsing)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
