{"id":4591,"library":"json-schema-for-humans","title":"JSON Schema for Humans","description":"JSON Schema for Humans is a Python library that generates beautiful, human-readable static HTML documentation from JSON schemas. It helps developers understand complex schema structures at a glance. The project is actively maintained with frequent patch and minor releases, typically on a monthly or quarterly cadence, providing new features and bug fixes.","status":"active","version":"1.6.0","language":"en","source_language":"en","source_url":"https://github.com/coveooss/json-schema-for-humans","tags":["documentation","json-schema","html","developer-tools","schema-generation"],"install":[{"cmd":"pip install json-schema-for-humans","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"symbol":"generate_from_filename","correct":"from json_schema_for_humans.generate import generate_from_filename"},{"note":"Use this function if you have the schema as a Python dict/object rather than a file path.","symbol":"generate","correct":"from json_schema_for_humans.generate import generate"}],"quickstart":{"code":"import json\nimport os\nfrom json_schema_for_humans.generate import generate_from_filename\n\n# Define a simple JSON schema\nschema_data = {\n    \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n    \"title\": \"User Profile\",\n    \"description\": \"Schema for a user profile object.\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"id\": {\"type\": \"string\", \"format\": \"uuid\", \"description\": \"Unique user ID\"},\n        \"name\": {\"type\": \"string\", \"minLength\": 1, \"description\": \"Full name of the user\"},\n        \"email\": {\"type\": \"string\", \"format\": \"email\", \"description\": \"User's email address\"},\n        \"age\": {\"type\": \"integer\", \"minimum\": 0, \"maximum\": 150, \"description\": \"User's age\"}\n    },\n    \"required\": [\"id\", \"name\", \"email\"]\n}\n\n# Create a directory for output and schema\nos.makedirs(\"schema_docs_output\", exist_ok=True)\nschema_file_path = os.path.join(\"schema_docs_output\", \"user_profile.json\")\noutput_dir = os.path.join(\"schema_docs_output\", \"html_docs\")\n\n# Save the schema to a file\nwith open(schema_file_path, \"w\") as f:\n    json.dump(schema_data, f, indent=2)\n\n# Generate documentation\ngenerate_from_filename(\n    schema_file_path,\n    output_dir,\n    config={\n        \"show_breadcrumbs\": True,\n        \"link_to_top\": True,\n        \"minify_html\": True\n    }\n)\n\nprint(f\"Documentation for '{schema_file_path}' generated successfully in '{output_dir}'.\")\nprint(\"You can open index.html in that directory in your browser.\")\n","lang":"python","description":"This quickstart demonstrates how to programmatically generate HTML documentation from a JSON schema file. It creates a dummy schema, saves it, and then uses `generate_from_filename` to produce an HTML output directory. You can customize the output using the `config` dictionary."},"warnings":[{"fix":"Upgrade your Python environment to 3.9+ or pin `json-schema-for-humans` to a version older than 1.3.1.","message":"Starting from version 1.3.1, `json-schema-for-humans` requires Python 3.9 or newer. Projects running on older Python versions (e.g., 3.7 or 3.8) will need to upgrade their Python interpreter or stick to `json-schema-for-humans < 1.3.1`.","severity":"breaking","affected_versions":"<1.3.1 to >=1.3.1"},{"fix":"Upgrade to `json-schema-for-humans` version `1.4.1` or newer to resolve these deprecation warnings.","message":"Versions prior to `1.4.1` might emit deprecation warnings from the underlying `BeautifulSoup4` library due to changes in its API. While these are warnings, they can clutter logs.","severity":"gotcha","affected_versions":"<1.4.1"},{"fix":"For programmatic use, import functions like `generate` or `generate_from_filename`. For CLI, use `json-schema-for-humans generate <schema_path> <output_dir>`.","message":"The library provides both a command-line interface (CLI) and a programmatic Python API. Ensure you are using the correct interface for your automation needs. The CLI is suitable for simple one-off generation, while the programmatic API offers more control and integration into build pipelines.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}