Convert JSON API responses to YAML schema
Project description
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
[
{
"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)
# Use custom input folder
json2yaml_schema --folder my_api_data_folder
Python API Usage
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()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file json_yaml_schema_converter-0.4.0.tar.gz.
File metadata
- Download URL: json_yaml_schema_converter-0.4.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9895f6adf5a2307b2d2afee681873e0d124b9d0e63c610488be9f26cffae1a5
|
|
| MD5 |
683ebe37793eddb82d3eddb3cd0456bd
|
|
| BLAKE2b-256 |
9fefbe9b0cc3a28169731688425610f42fdf96a59aae47448f1c3a732e289962
|
File details
Details for the file json_yaml_schema_converter-0.4.0-py3-none-any.whl.
File metadata
- Download URL: json_yaml_schema_converter-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bf0a8f7fb9a0341a084b98ee3034d021af61dfde9d352ab1469dbbaeb31b2d6
|
|
| MD5 |
f2b60b583817d395d170c17a043eca93
|
|
| BLAKE2b-256 |
f45ce9b33077a8b2ff5e6292c8ec7527e0b72d5bb5873368a8628742e090bdc3
|