--- id: genson version: "1.4.0" license: MIT license_treatment: permissive maintenance: active --- # genson — GenSON is a powerful, user-friendly JSON Schema generator. License: permissive · Maintenance: active · Downloads: 19.4M/mo ## What it is and what it does GenSON is a JSON Schema generator that takes JSON objects as input and produces JSON Schema documents describing their structure. Its core strength is the ability to merge schemas: you can feed it multiple JSON objects or existing schemas, and it will generate a single unified schema that accommodates all of them. The package follows three guiding rules: every input object must validate under the generated schema, any object valid under any input schema must also validate under the output, and the schema should be as strict as possible given those constraints. The package works with JSON Schema Draft 6 and above, though it uses only a subset of JSON Schema's keywords (type, properties, items, required, anyOf, enum, and a few others). It includes both a Python API via the SchemaBuilder class and a command-line tool for schema generation. GenSON is designed to help you skip boilerplate schema writing by inferring basic structure from your data, leaving detailed constraints for manual refinement. Use it for: - Automatically generate baseline JSON Schema from sample API responses to jumpstart validation rules. - Merge schemas from multiple data sources to find the common structure across heterogeneous datasets. - Build schema validators for incoming JSON data by inferring constraints from known-good examples. - Generate documentation schemas from production JSON objects without manual schema authoring. - Combine hand-written schemas with inferred ones to progressively refine data validation rules. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. GenSON generates JSON Schema documents from JSON objects and can merge multiple schemas together, inferring a unified schema that describes the common structure of your data. Yes. GenSON is actively maintained, has no external dependencies, supports current Python versions (3.10+), carries no known vulnerabilities, and solves a real problem—automating the tedious first step of schema creation. Use it when you need to generate or merge JSON schemas from data samples or existing schemas. The permissive MIT license poses no restriction. ## Install pip install genson uv add genson poetry add genson ## Installing genson Before you install: Low install friction with no runtime dependencies. Actively maintained as of 2026-07-06 with recent release history and stable production status. License in practice: MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install genson from genson import SchemaBuilder builder = SchemaBuilder() builder.add_object({"name": "Alice", "age": 30}) builder.add_object({"name": "Bob"}) schema = builder.to_schema() print(schema) Requires Python 3.10 or later. Verify before relying: - Whether the package handles deeply nested or very large JSON structures efficiently. - Performance characteristics when merging hundreds or thousands of schemas. - Extent of customization available through extensibility for non-standard merging behavior. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 19.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags json schema generator, infer schema from json, merge json schemas, json object to schema, schema builder python, json validation schema, generate jsonschema, json-schema, code-generation, data-validation [View on SkillFed](https://skillfed.io/packages/genson) · [View on PyPI](https://pypi.org/project/genson/)