json-yaml-schema-converter


Namejson-yaml-schema-converter JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/revan-more/json-yaml-schema-converter
SummaryConvert JSON API responses to YAML schema
upload_time2025-08-11 16:51:57
maintainerNone
docs_urlNone
authorRevan More
requires_python>=3.7
licenseNone
keywords json yaml schema converter api openapi swagger
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # JSON to YAML Schema Converter

A powerful Python tool that converts JSON API responses into YAML schema format with proper type definitions, titles, and format specifications.

## Features

- ✅ **Smart Type Detection**: Automatically detects and maps JSON types to schema types
- ✅ **Date-Time Recognition**: Identifies datetime strings and adds `format: date-time`
- ✅ **Nested Object Support**: Handles complex nested JSON structures
- ✅ **Array Processing**: Properly processes arrays and their item types
- ✅ **Title Generation**: Creates human-readable titles from JSON keys
- ✅ **CLI Interface**: Easy-to-use command-line interface
- ✅ **Batch Processing**: Convert multiple JSON files at once

## Your api response file should look like this e.g
All json file should be `build/output` inside the folder or response would be like below
```json
[
    {
        "id": 12345,
        "name": "test Innovations Corp",
        "legal_name": "Tech Innovations Corporation Inc.",
        "founded_date": "2020-01-15",
        "incorporation_date": "2020-01-15T09:00:00Z",
        "tax_id": "12-3456789",
        "website": "https://testinnovations.com",
        "industry": "Software Technology",
        "employee_count": 250,
        "annual_revenue": 15000000.75,
        "is_public": true,
        "stock_symbol": null
    },
    {
        "id": 4565,
        "name": "demo Innovations Corp",
        "legal_name": "demo Innovations Corporation Inc.",
        "founded_date": "2020-01-15",
        "incorporation_date": "2020-01-15T09:00:00Z",
        "tax_id": "12-3456789",
        "website": "https://testinnovations.com",
        "industry": "Software Technology",
        "employee_count": 250,
        "annual_revenue": 15000000.75,
        "is_public": true,
        "stock_symbol": null
    },
]
```
# Command Line Interface (CLI)
```bash
# Use custom input folder
json2yaml_schema --folder my_api_data_folder
```

## Python API Usage
```python
from json_yaml_schema_converter import JSONToYAMLConverter

# Initialize converter
converter = JSONToYAMLConverter("path/to/json/files")

# Convert all JSON files
converted_files = converter.process_all_json_files()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/revan-more/json-yaml-schema-converter",
    "name": "json-yaml-schema-converter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "json yaml schema converter api openapi swagger",
    "author": "Revan More",
    "author_email": "revanmore12@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/47/b0/81c8c1f61039d25da1dd0dadc9e97031a8809748ae6230a1f9a1f4d5c8c2/json_yaml_schema_converter-0.3.0.tar.gz",
    "platform": null,
    "description": "# JSON to YAML Schema Converter\n\nA powerful Python tool that converts JSON API responses into YAML schema format with proper type definitions, titles, and format specifications.\n\n## Features\n\n- \u2705 **Smart Type Detection**: Automatically detects and maps JSON types to schema types\n- \u2705 **Date-Time Recognition**: Identifies datetime strings and adds `format: date-time`\n- \u2705 **Nested Object Support**: Handles complex nested JSON structures\n- \u2705 **Array Processing**: Properly processes arrays and their item types\n- \u2705 **Title Generation**: Creates human-readable titles from JSON keys\n- \u2705 **CLI Interface**: Easy-to-use command-line interface\n- \u2705 **Batch Processing**: Convert multiple JSON files at once\n\n## Your api response file should look like this e.g\nAll json file should be `build/output` inside the folder or response would be like below\n```json\n[\n    {\n        \"id\": 12345,\n        \"name\": \"test Innovations Corp\",\n        \"legal_name\": \"Tech Innovations Corporation Inc.\",\n        \"founded_date\": \"2020-01-15\",\n        \"incorporation_date\": \"2020-01-15T09:00:00Z\",\n        \"tax_id\": \"12-3456789\",\n        \"website\": \"https://testinnovations.com\",\n        \"industry\": \"Software Technology\",\n        \"employee_count\": 250,\n        \"annual_revenue\": 15000000.75,\n        \"is_public\": true,\n        \"stock_symbol\": null\n    },\n    {\n        \"id\": 4565,\n        \"name\": \"demo Innovations Corp\",\n        \"legal_name\": \"demo Innovations Corporation Inc.\",\n        \"founded_date\": \"2020-01-15\",\n        \"incorporation_date\": \"2020-01-15T09:00:00Z\",\n        \"tax_id\": \"12-3456789\",\n        \"website\": \"https://testinnovations.com\",\n        \"industry\": \"Software Technology\",\n        \"employee_count\": 250,\n        \"annual_revenue\": 15000000.75,\n        \"is_public\": true,\n        \"stock_symbol\": null\n    },\n]\n```\n# Command Line Interface (CLI)\n```bash\n# Use custom input folder\njson2yaml_schema --folder my_api_data_folder\n```\n\n## Python API Usage\n```python\nfrom json_yaml_schema_converter import JSONToYAMLConverter\n\n# Initialize converter\nconverter = JSONToYAMLConverter(\"path/to/json/files\")\n\n# Convert all JSON files\nconverted_files = converter.process_all_json_files()\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Convert JSON API responses to YAML schema",
    "version": "0.3.0",
    "project_urls": {
        "Bug Reports": "https://github.com/revan-more/json-yaml-schema-converter/issues",
        "Documentation": "https://github.com/revan-more/json-yaml-schema-converter#readme",
        "Homepage": "https://github.com/revan-more/json-yaml-schema-converter",
        "Source": "https://github.com/revan-more/json-yaml-schema-converter"
    },
    "split_keywords": [
        "json",
        "yaml",
        "schema",
        "converter",
        "api",
        "openapi",
        "swagger"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0b2aed0fc0f11b86f344e1f2b3e25504e6b491dbc1f1e34ae1e6cf5216abf40d",
                "md5": "c1ca3e9da01c2d6180a79d57f6b2d4fb",
                "sha256": "2f45f38fc12b7ba9539fb83a7082b705fcae8e4fbdb4e2c97afc01176909547e"
            },
            "downloads": -1,
            "filename": "json_yaml_schema_converter-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1ca3e9da01c2d6180a79d57f6b2d4fb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8276,
            "upload_time": "2025-08-11T16:51:56",
            "upload_time_iso_8601": "2025-08-11T16:51:56.028429Z",
            "url": "https://files.pythonhosted.org/packages/0b/2a/ed0fc0f11b86f344e1f2b3e25504e6b491dbc1f1e34ae1e6cf5216abf40d/json_yaml_schema_converter-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "47b081c8c1f61039d25da1dd0dadc9e97031a8809748ae6230a1f9a1f4d5c8c2",
                "md5": "80fcfb8610eede67dfbc23cf2e8f566b",
                "sha256": "db8ad01aee45aceadd3f68860f25bf3878d976ea9a52ecca9d2b285b1dcecb82"
            },
            "downloads": -1,
            "filename": "json_yaml_schema_converter-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "80fcfb8610eede67dfbc23cf2e8f566b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6927,
            "upload_time": "2025-08-11T16:51:57",
            "upload_time_iso_8601": "2025-08-11T16:51:57.501202Z",
            "url": "https://files.pythonhosted.org/packages/47/b0/81c8c1f61039d25da1dd0dadc9e97031a8809748ae6230a1f9a1f4d5c8c2/json_yaml_schema_converter-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-11 16:51:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "revan-more",
    "github_project": "json-yaml-schema-converter",
    "github_not_found": true,
    "lcname": "json-yaml-schema-converter"
}
        
Elapsed time: 1.69229s