Skip to main content

schemax

Infer JSON Schema from sample data. Feed it one or more JSON files and get a clean, mergeable schema back.

Install

pip install schemax-cli

Usage

# Infer schema from a single file
schemax infer data.json

# Infer from multiple examples (schemas are merged)
schemax infer example1.json example2.json example3.json

# Infer from a JSON array (each element = sample)
schemax infer users.json

# From stdin
cat data.json | schemax infer -

# With title and compact output
schemax infer data.json --title "User" --compact

# Disable format detection
schemax infer data.json --no-formats

# Different draft version
schemax infer data.json --draft 7

Commands

Command Description
schemax infer Infer JSON Schema from sample data
schemax diff Show property differences across array elements
schemax validate Validate JSON and show structure summary

Format Detection

Automatically detects and annotates string formats:

  • date-time — ISO 8601 timestamps
  • date — YYYY-MM-DD dates
  • time — HH:MM:SS times
  • email — Email addresses
  • uri — HTTP(S) URLs
  • uuid — UUIDs
  • ipv4 — IPv4 addresses

Multi-File Merging

When given multiple files (or a JSON array), schemax merges schemas intelligently:

  • Object properties from all samples are combined
  • required = intersection (only keys present in ALL samples)
  • Types are widened (integer + number → number)
  • Nullable fields are detected
  • Conflicting types produce anyOf

For AI Agents

See SKILL.md for agent-optimized documentation.

License

MIT

Release files for schemax-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 schemax-cli 0.1.0
File Size Uploaded
schemax_cli-0.1.0.tar.gz 6.4 kB Details

Built distribution (wheel)

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

Total release size: 13.7 kB

Release files / schemax_cli-0.1.0.tar.gz

Download URL schemax_cli-0.1.0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c76ca2ef3728f6815c4864c0084b2f3b16f0197ed7d23040d4fde26d429e7aaa
BLAKE2b-256 checksum
How to use checksums
3c8fbfcd8ac76bed4b1d0fc7ec7a78018f671e7fca2ff77b1f8bb49e8e4428f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

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

Download URL schemax_cli-0.1.0-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3df304ca7c05b4e77d725395fcacdd96409f308c62c945b4e8f182056cc91cb
BLAKE2b-256 checksum
How to use checksums
5ef26e28790f30e167761d09cfbc002a67c6155668f5bbccbc78ebc5596e78cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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