Skip to main content

schemify-cli

Build JSON Schemas interactively, and fill JSON data from them, from the command line.

Source: github.com/aaltatan/schemify-cli

A web version runs at schemify.surge.sh (source): the same questions as fields, with the schema updating as you type.

Install

uv tool install schemify

Usage

schemify generate -t Person -o person.schema.json   # ask for the properties, write the schema
schemify fill person.schema.json -o person.json     # ask for one object matching it
schemify list person.schema.json -f python          # ask for a list of them
Command Alias Does
generate g Asks for the properties of an object and builds its JSON Schema (Draft 2020-12)
fill f Asks for data matching a schema file, checked against it
list l Asks for a list of items, each matching the schema
  • -o, --output saves to a file (asks before overwriting); without it the result is printed.
  • -f, --format picks the output of fill and list: json, python or javascript.

Types: string, integer, number, boolean, date, datetime, enum, array, object, each with its constraints (length, pattern, format, range, items, ...) and an optional default.

Computed properties

A property with x-compute is not asked in fill, it is computed from the other values:

"full_name": {"type": "string", "x-compute": {"fn": "join", "from": ["first", "middle?", "last"]}}
  • fn: the computer, from: source paths (a list, or an {alias: path} object for template and expr), options: extra arguments, default: the value when a source is missing.
  • Paths are relative to the owning object (address.city, items[0]), or to the root ($.company). items[*].price gives every price; a trailing ? makes a source optional.

Built-in computers:

  • Text: join, concat, template, upper, lower, title, capitalize, trim, replace, slice, initials, slug, length, pad, mask
  • Numbers: sum, subtract, multiply, divide, average, min, max, abs, round, percent, percent_of, expr
  • Dates: today, now, add_days, add_months, add_years, days_between, age, year, month, day, weekday, format_date, start_of_month, end_of_month
  • Number to words: words
  • Logic, lookup and misc: coalesce, if_else, equals, lookup, constant, count, count_if, unique, uuid

Reusing it in a typer app

schemify.cli.dependencies.schema exposes typer-di dependencies that load a schema file and ask for its data: FilledDataArgumentDI and FilledListArgumentDI take the path as an argument, FilledDataOptionDI and FilledListOptionDI as --js.

Development

uv sync
uv run pytest
uv run ruff check . && uv run mypy src

After changing generators.py, validators.py or computers.py, run pnpm sync && pnpm check in schemify-web so it stays in step.

Metadata

Release files for schemify-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schemify-cli 0.1.0
File Size Uploaded Provenance Actions
schemify_cli-0.1.0.tar.gz 20.4 kB Without provenance Details for schemify_cli-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schemify-cli 0.1.0
File Interpreter ABI Platform Actions
schemify_cli-0.1.0-py3-none-any.whl Python 3 none any Details for schemify_cli-0.1.0-py3-none-any.whl

Total release size: 45.6 kB

Release files / schemify_cli-0.1.0.tar.gz

Download URL schemify_cli-0.1.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
de0953bf64ebe6854f269108121c6af56ccb27543c613205f7dbe02731e44ae7
BLAKE2b-256 checksum
How to use checksums
60d870b588cb45827eb4846742d86fcbe869588c0c3e58c29c9fac56eff3ac98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / schemify_cli-0.1.0-py3-none-any.whl

Download URL schemify_cli-0.1.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcfc339e69285c87a96d337c0188b49990acbe1910dcb26c171f61097717c97b
BLAKE2b-256 checksum
How to use checksums
a26493aee792bb0dc13838a677916460fb11146d090c78ad02987daf0d85ec42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for schemify-cli 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page