Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hitchdev/strictyamljsonschema
Translate JSON schemas into StrictYAML schemas.
https://github.com/hitchdev/strictyamljsonschema
Last synced: 15 days ago
JSON representation
Translate JSON schemas into StrictYAML schemas.
- Host: GitHub
- URL: https://github.com/hitchdev/strictyamljsonschema
- Owner: hitchdev
- License: mit
- Created: 2018-10-20T12:54:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-20T12:55:59.000Z (about 6 years ago)
- Last Synced: 2024-11-07T09:41:10.857Z (2 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# StrictYAMLJSONSchema
Translate JSON schemas in to StrictYAML schema.
Simple example:
```json
{
"type": "object",
"properties": {
"age": {
"type": "integer"
},
"name": {
"type": "string"
},
"possessions": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["age", "name", "possession"]
}```
```yaml
# All about the character
name: Ford Prefect
age: 42
possessions:
- Towel```
```python
from strictyamljsonschema import load_schema
from strictyaml import load
import json```
Parse correctly:
```python
print(load(yaml_snippet, load_schema(json.loads(json_schema))).data)```
```yaml
OrderedDict([('name', 'Ford Prefect'), ('age', 42), ('possessions', ['Towel'])])
```## Install
```sh
$ pip install strictyamljsonschema
```